• Hello everybody I am novice with Krpan would like help from you.
    Sometimes I have a huge menu with more than 15 or 30 options.
    For the construction of it I use the following code:




    Code
    <action name="fillcombobox">plugin[combobox].removeall();additem('Varanda Foto 1', action(moveto1); );additem('Piscina Foto 02', action(moveto............
    
    
    
    
    <action name="moveto1">	action(startloading);	    loadpano(1.xml,null,KEEPALL,BLEND(2));	    lookat(-18,0,90);	    wait(blend);	    		oninterrupt(action(lookinterrupt));	    action(loadingdone);		set(plugin[titre].html,);		set(plugin[text].html,);		set(plugin[foto_box].url,%SWFPATH%/img/img1.png);		txtadd(plugin[titre].html, 'data:tt1');		txtadd(plugin[text].html, 'data:ttx1');
    
    
    	</action>	
    	<action name="moveto................





    As can be seen he repeats the same value moveto # 6 times. I wantedto reduce this action with a command like this one. Or any othereffectively.



    Code
    menu1=Varanda Foto 1
    i=0do while i < 39 i=i+1 additem('menu1', action(moveto+i); ); <action name="moveto+i">         action(startloading);   	    loadpano(i.xml,null,KEEPALL,BLEND(2));	    lookat(-18,0,90);	    wait(blend);	    		oninterrupt(action(lookinterrupt));	    action(loadingdone);		set(plugin[titre].html,);		set(plugin[text].html,);		set(plugin[foto_box].url,%SWFPATH%/img/img+i+.png);		txtadd(plugin[titre].html, 'data:tt+i');		txtadd(plugin[text].html, 'data:ttx+i'); </action>
    end while
  • Hi,

    here an example implementation:

    the menu texts where stored in a custom <menu> tag:

    Code
    <menu>
      <item name="m1" caption="Varanda Foto 1" />
      <item name="m2" caption="Piscina Foto 2" />
      ...
    </menu>

    then the used to fill the combobox:

    best regards,
    Klaus

  • This is exactly what I wanted, but he is with any errors.

    WARNING: not local trusted - ExternalInterface disabled!
    ERROR: action not found: moveto1

    Another observation, what is LT?

Participate now!

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