You are not logged in.

1

Tuesday, June 23rd 2009, 6:35am

One toggle code works; one doesn't

I'm trying the new beta 8 version and having one button (ie a single graphic) toggle on/off. In the examples below the full-screen toggle works perfectly , but the autorotate toggle doesn't have any effect.

Any clues ?

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
61
<action name="fullscreentoggle">
if(fullscreen == true, set(fullscreen,false); fullscreen == false, set(fullscreen,true); );"
</action>

<action name="rotatetoggle">
if(autorotate == true, set(autorotate,false); autorotate == false, set(autorotate,true); );"
</action>

<plugin name="rotate"
url="aa-rotate.jpg"
keep="true"
visible="true" enabled="true" handcursor="true" capture="true" children="true"
zorder="0"
alpha="0.70" blendmode="normal"
smoothing="true"
origin="leftbottom" edge="left"
x="116" y="20"
width="" height=""
scale="1"
onloaded=""
onover="set(blendmode,normal);set(alpha,1);"
onhover=""
onout="set(blendmode,normal);set(alpha,0.7);"
ondown=""
onup=""
onclick="action(rotatetoggle);"
ox=""
oy=""
rotate="0"
/>

<plugin name="fullscreen"
url="aa-fullscreen.jpg"
keep="true"
visible="true" enabled="true" handcursor="true" capture="true" children="true"
zorder="0"
alpha="0.70" blendmode="normal"
smoothing="true"
origin="leftbottom" edge="left"
x="10" y="20"
width="" height=""
scale="1"
onloaded=""
onover="set(blendmode,normal);set(alpha,1);"
onhover=""
onout="set(blendmode,normal);set(alpha,0.7);"
ondown=""
onup=""
onclick="action(fullscreentoggle);"
ox=""
oy=""
rotate="0"
/>

<autorotate enabled ="true"
waittime="3"
accel ="1"
speed ="2"
horizon ="0"
tofov ="NaN"
/>

michel

Professional

Posts: 1,153

Location: ANDORRA

Occupation: TV

  • Send private message

2

Tuesday, June 23rd 2009, 7:26am

Hi Richard,

Try autorotate.enabled

Source code

1
2
3
<action name="rotatetoggle">
if(autorotate.enabled == true, set(autorotate.enabled,false); autorotate.enabled == false, set(autorotate.enabled,true); );"
</action>


Salut.

3

Tuesday, June 23rd 2009, 7:31am

A thousand thankyous kind sir ! *smile*

4

Tuesday, June 23rd 2009, 9:40am

Hi,

for toggling you could also use the switch(var); action

e.g. just

Source code

1
switch(fullscreen);

or

Source code

1
switch(autorotate.enabled);

or

Source code

1
switch(state,1,2,3);
(switches "state" through 1,2,3)

best regards,
Klaus

Similar threads