Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : else...if, WHAT?!


cutandpastestudio
5/8/2004 9:38:41 PM
Hi There!

I would like some advice here:

I've got a one frame movie,
one layer with a movie clip with a rotating "Q"
on top of that a invizible button that, on rollOn, triggers the Q to start
rotating, and on rollOff, lets the Q finish its rotation and then stop

What I want to, is that if you rollon the (inv.) button again, WHILE the Q is
rotating, let the Q KEEP rotating, not start again

I guess I need an else if statement, but I can't figure it out!

Here's the set-up:

[b]the movieclip[/b] with the rotating Q has
- on layer 1: a frame label: fPlaying

- on actionlayer 2:
a frame with this actionscript:

(fPlaying) ? play() : stop();

- on layer 3: 30 keyframes of a rotating Q

[b]the movie[/b] - 1 frame long - has:

-on action layer 1: a frame with stop action

-on layer 2:
an invizible button with this script:

on(rollOver){
if (!rollingQ.fPlaying){
rollingQ.fPlaying = true;
rollingQ.gotoAndPlay("fPlaying");
}
}


on (rollOut) {
rollingQ.fPlaying = false;
}

-on layer 3:
an instance of the rotating Q movie clip; this instance is called rollingQ

So, like I said, how to - on rollOn - have the Q keep spinning on, if it has
already been triggered by a roll on.
(and there was an intermittent rollOff); and not jump to the first frame of
the movieclip and start the rotation again

I Hope I've stated my question clear.
Any help would be greatly appreciated!

Rene Heijt, Amsterdam
kglad
5/8/2004 10:24:48 PM
PETERSV
5/8/2004 10:38:38 PM
make a Q movieClip and load event put stop(), onRollOver event (invisible
buton), put _root.myQmovieClip.play() and a flag vaiabler in main timeline
example var myFlag =0 and onrollOver event also write myFlag=myFlag +1 and
write an if like this
if(myFlag==0) {
_root.myQmovieClip.play()
}
AddThis Social Bookmark Button