You are not logged in.

1

Monday, May 9th 2011, 2:59pm

Simplified menu

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:




Source code

1
2
3
4
5
6
7
<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.



Source code

1
2
3
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


2

Wednesday, May 11th 2011, 10:35am

Hi,

here an example implementation:

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

Source code

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


then the used to fill the combobox:

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
<plugin name="cb" url="plugins/combobox/combobox.swf" 
        onloaded="fillcombobox();"
        />

<action name="fillcombobox">
  removeall();
  additems();
</action>

<action name="additems">
  if(%1 != NEXT, set(i,0));
  additem(get(menu.item[get(i)].caption), movetoN(get(i)); ); 
  inc(i);
  if(i LT menu.item.count, additems(NEXT));
</action>

<action name="movetoN">
  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/img%1.png);		
  txtadd(plugin[titre].html, 'data:tt%1');		
  txtadd(plugin[text].html, 'data:ttx%1'); 
</action>


best regards,
Klaus

3

Thursday, May 12th 2011, 3:25am

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?

4

Thursday, May 12th 2011, 3:52am

I discovered the problem in this xml file with another

<krpano version="1.0.8" onstart="action(moveto1); closebox(); incio(); " >

thanks

5

Thursday, May 12th 2011, 4:46am

I am still having a doubt.
All menu items leads to the same pano

I do not know what I put into <krpano version="1.0.8" onstart="">



manigordo

Trainee

Posts: 75

Location: Costa Rica

  • Send private message

6

Saturday, January 28th 2012, 12:42am

Hi weslley,

I'm trying to make a menu but I dont know how. Can u post a sample of yours to see it?
I want to know if yours is like the one I'd like to do.

Thanks man *smile*

Similar threads