Skip to main content
Diliard
Participant
July 1, 2019
Answered

Animation only playing on Hover

  • July 1, 2019
  • 1 reply
  • 1236 views

Hello, I use Flash CS6 and AS2 and i made a animation with a waterball.

So the problem is i dont want the animation to run instantly at loading the SWF up only if you Hover over it.

Can you guys please tell me what i need to change to make it really only at hover?

Thanks.

-Marc                        

This topic has been closed for replies.
Correct answer n. tilcheff

It  Helps a bit^^ But the problem is that like the Animation is playing as soon as the SWF Gets Loaded/Started and i dont want tht i just want it to come up at a Hover.


Maybe you did not understand me.

On the first frame of the button show only the first frame of the animation or nothing if you like.

On the roll over state put the animation.

Then when the SWF loads you will have a static image and only it will play when you hover over it.

You can show on the first frame of the button the container, but switch it to Graphic and stop it.

1 reply

kglad
Community Expert
Community Expert
July 1, 2019

assuming you have no streams (eg, video and sound), list all frame 1 movieclips in an array, eg

this.onRollOver = overF;  // note: you may need an object with _alpha=0 on stage.

var mcA:Array=[_this,mc1,mc2,...];   // should contain, at least, _this

playF(mcA,false);

function overF():Void{

playF(mcA,true);

}

function playF(a:Array,b:Boolean):Void{

if(b){

for(var i:Number=i<mcA.length;i++){

MovieClip(mcA.play());

}

// may want to 'delete' event listener

} else {

for(var i:int=i<mcA.length;i++){

MovieClip(mcA.stop());

}

}

Diliard
DiliardAuthor
Participant
July 1, 2019

Am i supposed to set that into the AS Code of the animation?

kglad
Community Expert
Community Expert
July 1, 2019

yes, that should be added to the actions panel, frame 1 of the main timeline