|
|
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 |
<!-- show or hide level
%1:Object level
%2:Boolean show or hide
%3:Boolean no alpha animation
-->
<action name="showLevel">
<!-- level visibility -->
set(sLayer,get(level[%1].val));
set(bShow,get(%2));
trace('showLevel ',%1,' ',%2,' ',%3,' p: ',level[%1].point.count);
if(%3==true,<!-- damn you stupid crossfade -->
set(plugin[get(sLayer)].alpha,1);
set(plugin[get(sLayer)].visible,get(bShow));
,
set(fAlpha,0);
if(bShow==true,
set(fAlpha,1);
set(plugin[get(sLayer)].alpha,0);
set(plugin[get(sLayer)].visible,true);
);
tween(plugin[get(sLayer)].alpha, get(fAlpha), 0.25, linear,
if (bShow==false,
set(plugin[get(sLayer)].visible, false);
);
set(plugin[get(sLayer)].alpha,1);
trace('tweendone ',sLayer,' ',bShow); <!-- this is only traced once, even if the action is called twice -->
);
);
</action>
|
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 |
set(plugin[map].foo, -300);
set(plugin[maphide].foo, 400);
set(asdf,'map');
tween(plugin[get(asdf)].foo, 132, 0.5, linear,
trace('???????tweenTestDone ',plugin[get(asdf)].foo);
);
set(asdf,'maphide');
tween(plugin[get(asdf)].foo, 312, 0.5, linear,
trace('!!!!!!!tweenTestDone ',plugin[get(asdf)].foo);
);
|
This post has been edited 1 times, last edit by "Sjeiti" (Feb 16th 2011, 12:25am)
|
|
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 |
<var
foo="0"
bar="1"
baz="2"
/>
<bar
foo="3"
bar="2"
baz="1"
/>
<bar name="foo"
foo="3"
bar="2"
baz="1"
/>
<bar name="bar"
foo="3"
bar="2"
baz="1"
/>
<action name="startup">
<!-- this works -->
set(baz,var.foo);
tween(get(baz), 132, 0.5, linear,
trace('get(baz) done ',get(baz));
);
set(baz,bar.foo);
tween(get(baz), 543, 0.5, linear,
trace('get(baz) done ',get(baz));
);
<!-- this does not -->
set(a,'foo');
tween(bar[get(a)].foo, 132, 0.5, linear,
trace('bar[get(a)].foo done ',get(bar[get(a)].foo));
);
set(a,'bar');
tween(bar[get(a)].foo, 132, 0.5, linear,
trace('bar[get(a)].foo done ',get(bar[get(a)].foo));
);
</action>
|
|
|
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 |
<var
foo="0"
bar="1"
baz="2"
/>
<bar
foo="3"
bar="2"
baz="1"
/>
<bar name="foo"
foo="30"
bar="20"
baz="10"
/>
<bar name="bar"
foo="31"
bar="21"
baz="11"
/>
<action name="truc">
trace('var.foo = ',var.foo,' -- var.bar = ',var.bar,' -- var.baz = ',var.baz);
trace('bar.foo = ',bar.foo,' -- bar.bar = ',bar.bar,' -- bar.baz = ',bar.baz);
trace('bar[foo].foo = ',bar[foo].foo,' -- bar[foo].bar = ',bar[foo].bar,' -- bar[foo].baz = ',bar[foo].baz);
trace('bar[bar].foo = ',bar[bar].foo,' -- bar[bar].bar = ',bar[bar].bar,' -- bar[bar].baz = ',bar[bar].baz);
);
</action>
|
|
|
Source code |
1 2 3 4 |
INFO: var.foo = 0 -- var.bar = 1 -- var.baz = 2 INFO: bar.foo = 31 -- bar.bar = 21 -- bar.baz = 11 INFO: bar[foo].foo = 31 -- bar[foo].bar = 21 -- bar[foo].baz = 11 INFO: bar[bar].foo = 31 -- bar[bar].bar = 21 -- bar[bar].baz = 11 |
|
|
Source code |
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<bar name="foo" foo="30" bar="20" baz="10" /> <bar name="bar" foo="31" bar="21" baz="11" /> <bar foo="3" bar="2" baz="1" /> |
|
|
Source code |
1 2 3 4 |
INFO: var.foo = 0 -- var.bar = 1 -- var.baz = 2 INFO: bar.foo = bar.foo -- bar.bar = bar.bar -- bar.baz = bar.baz INFO: bar[foo].foo = 30 -- bar[foo].bar = 20 -- bar[foo].baz = 10 INFO: bar[bar].foo = 31 -- bar[bar].bar = 21 -- bar[bar].baz = 11 |
|
|
Source code |
1 2 3 4 5 6 7 8 9 |
set(plugin[map].foo, -300);
set(plugin[maphide].foo, 400);
set(asdf,'map');
tween(plugin[get(asdf)].foo, 132, 0.5, linear, WAIT); <!-- WAITING the end of the tween before continuing with the rest of the actions list-->
trace('???????tweenTestDone ',plugin[get(asdf)].foo);
set(asdf,'maphide');
tween(plugin[get(asdf)].foo, 312, 0.5, linear,
trace('!!!!!!!tweenTestDone ',plugin[get(asdf)].foo);
);
|
This post has been edited 5 times, last edit by "michel" (Feb 16th 2011, 6:14pm)
|
|
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 |
<!-- show or hide level
%1:Object level
%2:Boolean show or hide
%3:Boolean no alpha animation
-->
<action name="showLevel">
<!-- level visibility -->
set(sLayer,get(level[%1].val));
set(bShow,get(%2));
trace('showLevel ',%1,' ',%2,' ',%3,' p: ',level[%1].point.count);
if(%3==true,<!-- damn you stupid crossfade -->
set(plugin[get(sLayer)].alpha,1);
set(plugin[get(sLayer)].visible,get(bShow));
,
set(fAlpha,0);
if(bShow==true,
set(fAlpha,1);
set(plugin[get(sLayer)].alpha,0);
set(plugin[get(sLayer)].visible,true);
);
tween(plugin[get(sLayer)].alpha, get(fAlpha), 0.25, linear, WAIT);
if (bShow==false,
set(plugin[get(sLayer)].visible, false);
);
set(plugin[get(sLayer)].alpha,1);
trace('tweendone ',sLayer,' ',bShow); <!-- this is only traced once, even if the action is called twice -->
);
</action>
|
,
. I missed the need of crossfade
Quoted
Only it's still not a crossfade, due to the wait of course.
... Sorry
... So, try avoiding to set variables from the parameters, instead, try use them directly...
Quoted
.....tween fails when the same variable is used with different values
|
|
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 |
<!-- show or hide level
%1:Object level
%2:Boolean show or hide
%3:Boolean no alpha animation
-->
<action name="showLevel">
<!-- level visibility -->
trace('showLevel ',%1,' ',%2,' ',%3,' p: ',level[%1].point.count);
if(%3==true,<!-- damn you stupid crossfade -->
set(hotspot[%1].alpha,1);
set(hotspot[%1].visible,%2);
,
set(fAlpha,0);
if(%2==true,
set(fAlpha,1);
set(hotspot[%1].alpha,0);
set(hotspot[%1].visible,true);
);
tween(hotspot[%1].alpha, get(fAlpha), 0.25, linear,
if (%2==false,
set(hotspot[%1].visible, false);
);
set(hotspot[%1].alpha,1);
trace('tweendone ',sLayer,' ',%2); <!-- this is only traced once, even if the action is called twice -->
);
);
</action>
|
,It remember me the points of an Polygonal Hotspots... But, without an example, I do not know the particular use made by Sjeiti ...
Quoted
btw, what is this level[%1].point.count ?
!!
Quoted
btw, what is this level[%1].point.count