Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Animation only playing on Hover

New Here ,
Jul 01, 2019 Jul 01, 2019

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                        

1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Valorous Hero , Jul 02, 2019 Jul 02, 2019

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.

Translate
Community Expert ,
Jul 01, 2019 Jul 01, 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());

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2019 Jul 01, 2019

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2019 Jul 01, 2019

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 01, 2019 Jul 01, 2019

It gives me many errors that it expects ; and unexpected apperiance of . or class called "int" cant be loaded and block needs to be closed with } 😕

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 01, 2019 Jul 01, 2019

try:

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:Number=i<mcA.length;i++){

MovieClip(mcA.stop());

}

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 02, 2019 Jul 02, 2019

Hi mate,

A very simple way may be to put your animation inside a Button symbol on the Roll over frame and then define the hover area.

While the mouse is over, the animation which should be inside a Movieclip, will loop, unless you have a stop somewhere.

Hope this helps!

Nick - Character Designer and Animator, Flash user since 1998
Member of the Flanimate Power Tools team - extensions for character animation
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2019 Jul 02, 2019

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 02, 2019 Jul 02, 2019

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.

Nick - Character Designer and Animator, Flash user since 1998
Member of the Flanimate Power Tools team - extensions for character animation
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2019 Jul 02, 2019
LATEST

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jul 02, 2019 Jul 02, 2019

Here is a sample setup: hover_to_play.fla - Google Drive

Nick - Character Designer and Animator, Flash user since 1998
Member of the Flanimate Power Tools team - extensions for character animation
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines