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.
ComboBox Options
-
-
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:
Code
Display More<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 -
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:
Code
Display More<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 ?
-
Hi,
yes, there is a "selectitem" function
have a look: -
I've tried the following:
Codeset(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)
-
-
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!
-
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?
-
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 versionI have made now a simple XML example to demonstrate how the selectitem will work,
change the complete combobox2.xml to this:Code
Display More<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>
-
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 ?
-
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 -
-
-
Thanks a bunch Klaus!
Found out how to embed a font as well: http://www.gotoandlearnforum.com/viewtopic.php?f=29&t=14638#p74303
-
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
by
Then, i added this line code in the startplugin() function :
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
-
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 -
Thanks anyway Klaus !
I'll keep searching ... -
How do I change the number of lines in the combobox?
default = 5 -
How do I change the number of lines in the combobox?
default = 5If you talk about the number visible without scrolling it is something I also would be interested in.
Hans
-
-
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!