There are stop actions in frames 10, 20, and 30.
There are labels in frames 10("one"), 20("two"), and 30("three").
Theres a button on the main timeline that, onrelease, creates a variable
named "a"using the math.random function to create a random number
between1 and 3. the code:
on (release) {
a = Math.floor(Math.random()*3)+1;
}
I have an output textbox to see the variable "a".
theres also a button on the timeline that has the following code:
on (release) {
if (a==1) {
gotoAndPlay ("one");
} else if (a==2) {
gotoAndPlay ("two");
} else if (a==3) {
gotoAndPlay ("three");
} else {
stop ();
}
}
This is what happens. When a=1, the play head goes to "one" and stops.
When a=3, it goes to "three' and stops. But, when a=2, the playhead goes
stays at "one" AND "a" changed to 1.
What am I missing here?
thanks!
Tim S.:
Lose the else. Won't fix your problem but it's never going to get executed
(unless you later add other #s than 1-3).
Seems like it should work but have you made sure that frame "two" is
actually spelled "two"?
Can't say more w/o seeing the fla.
Thanks,
Tim
And then instead of a complex conditional, have your button action like
this:
on (release) {
gotoAndPlay ("section" + a);
a = 0;
}
--
Byron "Barn" Canfield
Canfield Studios: http://www.byronc.com
"mike sieron" <m...@sieron.com> wrote in message
news:3BBD3D43...@sieron.com...
That could explain the problem.
Check all you = and == and ensure you use double== when you should and vice
versa !!
--
"mike sieron" <m...@sieron.com> wrote in message
news:3BBD3D43...@sieron.com...
--
Byron Canfield
Canfield Studios
http://www.byronc.com
----- I do not respond to private emails, nor do I reply to posts by
email. -----
mike sieron <m...@sieron.com> wrote in message
news:3BBDCC8E...@sieron.com...