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

Animation only playing on Hover

New Here ,
Jul 01, 2019 Jul 01, 2019

Copy link to clipboard

Copied

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                        

Views

691

Translate

Translate

Report

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

Guru , 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.

Votes

Translate

Translate
Community Expert ,
Jul 01, 2019 Jul 01, 2019

Copy link to clipboard

Copied

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());

}

}

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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 } 😕

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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());

}

}

}

Votes

Translate

Translate

Report

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
Guru ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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
Guru ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Thanks!

Votes

Translate

Translate

Report

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
Guru ,
Jul 02, 2019 Jul 02, 2019

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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