You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Saturday, November 29th 2008, 4:13am

ComboBox Options

Hi, I was playing with the Combo Box plugin and I noticed that in the demos it loaded sphere images - is there a way to load different XML files through it instead. I use tiles for my tours, so loading sphere wouldn't work for my app.

2

Saturday, November 29th 2008, 8:31pm

Hi,

yes, you can apply any actions to a combobox item - loading a xml, a image, changing something...

at the moment I recommend this way to set actions for a combobox:
  • add the combobox items dynamically in the onloaded event
  • assign a action for each item
here is a example:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<plugin name="combobox"
        url="%SWFPATH%/plugins/combobox.swf" 
        align="lefttop" 
        x="10" 
        y="10" 
        width="33%"
        keep="true"
        onloaded="action(setupitems);"
        />
	
<action name="setupitems">
    removeall();
    additem(Item 1, action(item1) );
    additem(Item 2, action(item2) );
    additem(Item 3, action(item3) );
</action>

<action name="item1">
    loadpano(pano1.xml);
</action>

<action name="item2">
    loadpano(pano2.xml);
</action>

<action name="item3">
    loadpano(pano2.xml);
</action>


best regards,
Klaus

3

Friday, December 19th 2008, 8:56pm

PROBLEM: Working with HOTSPOTS and the ComboBox.

Is there a way to change just the comboxbox item name when a hotspot is clicked within a virtual tour? For example:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<action name="setupitems"> 
    removeall();
    additem(Garten, action(load1);); 
    additem(Keller1, action(load2);); 
    additem(Keller2, action(load3);); 
    additem(Stuebal, action(load4);); 
</action>
 
<action name="load1"> 
    set(plugin[spotx].x,200); 
    set(plugin[spotx].y,50); 
    set(plugin[radar].x,200); 
    set(plugin[radar].y,50); 
    loadpano(Garten.xml,null,KEEPALL,BLEND(1)); 
    set(plugin[radar].heading,0); 
</action>


When you have this and you use the combobox, then the hotspot adjusts accordingly because it is inside an action. But if you click the hotspot to change the panorama, then the combobox doesn't change the name. So is there something like SETITEM or similar to use to change just the name of the dropdown item in the comboxbox ?

4

Friday, December 19th 2008, 9:59pm

Hi,

yes, there is a "selectitem" function
have a look:

http://krpano.com/plugins/combobox/#selectitem

5

Saturday, December 20th 2008, 1:32am

I've tried the following:

Source code

1
2
set(plugin[combobox].selectitem(combobox:Exterior Sunset)); 
set(plugin[combobox].selectitem(Exterior Sunset));


doesn't seem to work? Also, when you do capitalize the words, ex: <action name="combobox:Exterior Sunset"> , the capital letters don't work? (see combobox.xml you've provided in the download ZIP file, there are no capital letters)

6

Monday, December 22nd 2008, 4:26pm

Hi,

the "set" is wrong
just use only:

Source code

1
plugin[combobox].selectitem(combobox:Exterior Sunset);



I know the problem/bug with the capital letters,
a possiblity to fix it at the moment is to use additem() instead of <action name="combobox:...">

7

Wednesday, December 24th 2008, 12:19am

Ok, I've tried it without "set" and it still doesn't seem to work; I've tried setting the combo boxes up using both methods. Using the latest 1.0.8 beta 4

Can you please look into this Klaus, maybe provide a working example as well?

THANK YOU! *thumbsup*

8

Monday, January 5th 2009, 9:24pm

Hi Klaus,

You've been of great help, it is much appreciated.

Sorry to come back to this again, but I think your example has bugs to begin with in the first place. In your compiled zip file: krpano/examples/combobox/combobox.html when you load this page and press the "O" and you get a DEBUG: combobox - startplugin same with combobox2.html

So maybe that's why selectitem() doesn't work since it needs to be debugged in the first place?

9

Wednesday, January 7th 2009, 1:50pm

Hi,

this "DEBUG: combobox - startplugin" message is because I forget to remove the debug traces
in the combobox plugin, and the debugmode is enabled in the beta version

I have made now a simple XML example to demonstrate how the selectitem will work,
change the complete combobox2.xml to this:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<krpano version="1.0.8" onstart="action(pano1);">

    <plugin name="combobox"
        	url="%SWFPATH%/plugins/combobox.swf" 
        	align="lefttop" 
        	x="10" 
        	y="10" 
        	width="15%"
        	keep="true"
        	onloaded="action(setupitems);"
        	/>
	
	
    <action name="setupitems">
        removeall();
        additem(Pano 1, action(pano1) );
        additem(Pano 2, action(pano2) );
    </action>

    <action name="pano1">
        <!-- select combobox item -->
        plugin[combobox].selectitem(Pano 1);

        <!-- load pano image -->
        loadpano(null,sphere=../tour/skeller.jpg,KEEPALL,BLEND(1));
	
        <!-- set view -->
        lookat(0,0,90);
		
        <!-- dynamically add a hotspot -->
        addhotspot(keller);
        set(hotspot[keller].url,../tour/hotspot_ani.swf);
        set(hotspot[keller].ath,9);
        set(hotspot[keller].atv,-4);
        set(hotspot[keller].blendmode,invert);
        set(hotspot[keller].onhover, showtext(Pano 2));
        set(hotspot[keller].onclick, looktohotspot(keller); action(pano2); );
    </action>
	
    <action name="pano2">
        <!-- select combobox item -->
        plugin[combobox].selectitem(Pano 2);

        <!-- load pano image -->
        loadpano(null,sphere=../tour/keller.jpg,KEEPALL,BLEND(1));

        <!-- set view -->
        lookat(0,0,90);
		
        <!-- dynamically add a hotspot -->
        addhotspot(skeller);
        set(hotspot[skeller].url,../tour/hotspot_ani.swf);
        set(hotspot[skeller].ath,8);
        set(hotspot[skeller].atv,7);
        set(hotspot[skeller].scale,1.4);
        set(hotspot[skeller].blendmode,invert);
        set(hotspot[skeller].onhover,showtext(Pano1));
        set(hotspot[skeller].onclick, looktohotspot(skeller); action(pano1); );
    </action>
</krpano>

10

Tuesday, January 27th 2009, 11:49am

Everything is working good now. Just playing with the .FLA file for the combobox, is there a way to change the font family, font color, and the font size? I couldn't find the reference in the actionscript ? *confused*

11

Tuesday, January 27th 2009, 10:11pm

Hi,

I haven't work much with the Flash Combobox yet,
maybe this helps:

http://help.adobe.com/en_US/AS3LCR/Flash_10.0/fl/controls/ComboBox.html#getStyleDefinition()

best regards,
Klaus

12

Wednesday, January 28th 2009, 8:10am

Ok, so to change the font color to white, where would I put

Source code

1
combobox.setStyle("color", 0xFFFFFF);

in the actionscript ? Is it somewhere in the krpano_as3_interface.as ? I'm pretty new to Flash CS3.

Any help would be *w00t*

13

Thursday, January 29th 2009, 7:05pm

Hi,

no this needed to be done in the combobox.fla,

open it in Flash CS3,
then open the "actions" window and then the source,
and try to add this line in the startplugin() function, e.g.:

Source code

1
2
3
4
function startplugin(event:Event):void
{
combobox.setStyle("color", 0xFFFFFF);
....


best regards,
Klaus

14

Friday, January 30th 2009, 8:13am

Thanks a bunch Klaus!

Found out how to embed a font as well: http://www.gotoandlearnforum.com/viewtop…&t=14638#p74303

15

Wednesday, February 24th 2010, 11:55am

Problems skinning font color of combobox

Hi,

I'm using Krpano 1.0.8, and i'm trying to change the font color of the combobox plugin.

So, i took the combobox.fla (1.0.7) and i changed the AS code to allow the combobox to work in 1.0.7 and all higher versions :

I replaced

Source code

1
if ( krpano.get("version") != "1.0.7" )


by

Source code

1
if ( krpano.get("version") < "1.0.7" )


Then, i added this line code in the startplugin() function :

Source code

1
2
3
4
5
function startplugin(event:Event):void
{	
 	combobox.setStyle("color", 0xBFB179);
 	...
}


I saved the fla in .cs3 and then i had a warning alert from Adobe Flash CS4

"The file has data which will be lost in case of saving in Flash cs3 format :
- Metadata of the infobox on the XMP file
Would you like to save in cs3 format anyway ?"

I clicked "yes" and i compiled in .swf.

RESULT : the font color stays in black (default), there's no change

Can someone tell me what i did wrong ? Is it because of the warning alert ?

Thanks for your response

This post has been edited 1 times, last edit by "MissZougou" (Feb 24th 2010, 12:28pm)


16

Wednesday, February 24th 2010, 1:49pm

Hi,
Can someone tell me what i did wrong ? Is it because of the warning alert ?
no, sorry, no idea at the moment,
but it's not because of the warning,

best regards,
Klaus

17

Thursday, February 25th 2010, 11:46am

Thanks anyway Klaus !
I'll keep searching ...

N'drew

Beginner

Posts: 17

Location: RUSSIA

Occupation: IT engineer

  • Send private message

18

Monday, April 26th 2010, 4:43pm

How do I change the number of lines in the combobox?
default = 5

HansNyb

Professional

Posts: 810

Location: Denmark

Occupation: Photographer

  • Send private message

19

Monday, April 26th 2010, 5:38pm

How do I change the number of lines in the combobox?
default = 5


If you talk about the number visible without scrolling it is something I also would be interested in.

Hans

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

20

Monday, April 26th 2010, 6:10pm

Hi,

Use the rowcount attribute... You can view an example on the FOV types examples

Source code

1
<plugin name="combobox" url="%SWFPATH%/plugins/combobox.swf" ..... rowcount="10"  />


SAlut.

Similar threads