[Solved] Combobox scene update problem

  • I have two ways the change scene in my tour, combobox and polygonal hotspot. Using hotspot to changing scene does not update the combobox does not update the scene label.

    I used the code suggested by Jesse and Klaus from here

    Combobox problem

    It is not working and I can't figure out how to fix it, i have attached my xml. Can someone help me please?

    TIA

  • Hi Yoshiharra

    I think I have found the answer

    I see you fell for the same issue as me, i.e. putting in <events onloadcomplete="plugin[combobox].selectitem('8572');"/>

    as suggested elsewhere!! I thought that was some clever code but actually that was a specific solution to that particular tour *cursing*

    Anyway it might work but you will need to change combobox to cb (the name you gave the plugin) and 8572 change to your own item, not the one in that solution.

    But my solution for example in your first scene is to change from

    <scene name="scene_Dinning" title="Dinning" onstart="" thumburl="panos/Dinning.tiles/thumb.jpg">
    <events onloadcomplete="plugin[combobox].selectitem('8572');"/>
    <view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" limitview="auto" />

    TO

    <scene name="scene_Dinning" title="Dinning" onstart="action(startscene);" thumburl="panos/Dinning.tiles/thumb.jpg">

    <action name="startscene">
    plugin[cb].selectIdItem(item1);
    </action>

    <view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" limitview="auto" />

    BUT ALSO CHANGE

    <plugin name="cb" style="combobox" align="lefttop" x="10" y="10" width="90" keep="true">
    <item name="item1" caption="Dinning" onclick="loadscene(scene_Dinning,null,MERGE,BLEND(1));" />
    <item name="item2" caption="Living" onclick="loadscene(scene_Living,null,MERGE,BLEND(1));" />
    ..........................

    I think that should work, but I am no expert *unsure*

  • Steve, I think you are expert, compared to my skills (zero)! *g* I have no idea how you figured it out. I am just a copy cat, try to take codes people post and hope it works (but you figured that out already *wink* )

    I will give it a try and let you know.

    Thanks

  • Hi Steve

    I ma getting "xml parser error: element is malformed (#1090)", here is what I did (see if you can any mistake) -

    Code
    <plugin name="cb" style="combobox" align="lefttop" x="10" y="10" width="90" keep="true">       
        	<item name="item1" caption="Dinning" onclick="loadscene(scene_Dinning,null,MERGE,BLEND(1));" />
        	<item name="item2" caption="Living" onclick="loadscene(scene_Living,null,MERGE,BLEND(1));" />
        	<item name="item3" caption="Bar" onclick="loadscene(scene_Bar,null,MERGE,BLEND(1));" />
        	
            ............
    
    
        	<item name="item10" caption="Studio" onclick="loadscene(scene_Studio,null,MERGE,BLEND(1));" />
    	</plugin>

    and —

    Code
    <scene name="scene_Dinning" title="Dinning" onstart="action(startscene);" thumburl="panos/Dinning.tiles/thumb.jpg">
    		
    		<action name="startscene">
    		plugin[cb].selectIdItem(item1);
    		</action>
    
    
    		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" limitview="auto" />
                    ...............

    then —

    Code
    <scene name="scene_Living" title="Living" onstart="" thumburl="panos/Living.tiles/thumb.jpg">
    	
    		<action name="startscene">
    		plugin[cb].selectIdItem(item2);
    		</action>
    	
    		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" limitview="auto" />
                   ..........

    and —

    Code
    <scene name="scene_Bar" title="Bar" onstart="" thumburl="panos/Bar.tiles/thumb.jpg">
    	
    		<action name="startscene">
    		plugin[cb].selectIdItem(item3);
    		</action>
    	
    		<view hlookat="0" vlookat="0" fovtype="MFOV" fov="90" maxpixelzoom="2.0" fovmin="60" fovmax="120" limitview="auto" />
                    ...........

    etc., etc.

    Suggestion?

    Thanks

  • Hi Yoshiharra

    Flattery will get you everywhere!!!

    I am a copy cat too. You just need to know which bits to copy, that is the tricky bit. *thumbsup*

    Firstly get rid of the

    ..........................

    that was just my etc etc

    and you need onstart="action(startscene);"

    in each and every scene. That is the bit that changes the combobox label

    Try that first. When testing I find that commenting out sections that are just add on is best to isolate the problem

    That is putting <!-- --> around that element

    Also just get a couple of scenes working first before you dive i the deep end.

  • Hi Steve

    I used "........." to truncate lines of codes, just wanted to illustrate how I used your suggestion, i.e. named scenes as item1, item2, item3 etc.

    Then in every scene used the following —

    Code
    <action name="startscene">
    		plugin[cb].selectIdItem(item1);
    		</action>
    Code
    <action name="startscene">
    		plugin[cb].selectIdItem(item2);
    		</action>
    Code
    <action name="startscene">
    		plugin[cb].selectIdItem(item3);
    		</action>

    etc.

    But getting error as I mentioned earlier. Am I missing anything?

    Thanks

  • View your xml files in Firefox and fix the duplicate errors and any other errors Firefox shows until it doesn't have any errors.

    Here is the first one (again)

    By the way, you have usecontentsize duplicated twice. Remove that and the xml will be valid.

    XML Parsing Error: duplicate attribute
    Location: file:///C:/Documents%20and%20Settings/Owner/My%20Documents/Downloads/tour.xml
    Line Number 176, Column 11: usecontentsize="false"

  • Yes, you have two hotspots that have that posted two times in the plugin. Once you correct the duplicate entries, view it again in Firefox and it should show all of the XML without errors. You should no longer get the error. If it still shows, try clearing the cache of your computer.

  • Thanks Jarredja, will do.

    On the other hand, I am having problem updating combobox label if I go to a scene via polygonal hotspot. Steve had helped me getting this far, but still not working. He is using hotspot, I am using polygon, that's the only difference. His is working, mine is not. Any idea? Thought I will pick your brain *wink*

    Plugin:

    sceene:

    and

    Thanks

  • Here is what you have in the Dining scene

    <scene name="scene_Dinning" title="Dinning" onstart="" thumburl="panos/Dinning.tiles/thumb.jpg">
    <events onloadcomplete="plugin[combobox].selectitem('8572');"/>


    Replace it with this.

    <scene name="scene_Dinning" title="Dinning" onstart="startscene();" thumburl="panos/Dinning.tiles/thumb.jpg">
    <action name="startscene">

    plugin[cb].selectIdItem(scene_Dinning);
    </action>

    Then work through each scene replacing each line to fit the scene.


    I believe that is all I replaced, although I may have made additonal changes elsewhere in the xml. Let me know if this corrects your issue.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!