Share to EffectHub.com

You can earn money or coins from your share:)

Tips: you can use Sparticle for uploading away3D effects.

Tips: you can download Sparticle for uploading effects.

Tips: The ActionScript editor is supporting Away3D, Starling, Dragonbones and Flex frameworks.

Tips: paste the web page URL then click button:)

How do you create a button to start an animation, in Flash CS6/ActionScript 3?



I have created an animation of some Windmill Sails rotating, it is on a layer called "sails", and has an instance name of "sails". I have also created a button, which is on a layer called "button", and has an instance name of "button". I have also converted them both to a symbol (the sails are a movie clip, and the start button is a button).

 

What code do I need to write so that when I click the button, the animation starts playing?

 

Thank you for any help.


Tags

3215 views    1 answers

The Best Answer

0


If you are writing code in as3 here are following steps.

 1. Double click windmill movieclip and write code stop() at first frame.(by pressing F9 key you'll see actionsctipt editor)

2. Go back to main stage

3.make a new layer and name it actionscript

4.Write down following codes:.


button.addEventListener(MouseEvent.CLICK, startRotation);

 function startRotation(e:MouseEvent):void 

{

 sails.play();

}

 it will work.

if you want working .FLA file then i can help.:)

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: helpers/time_helper.php

Line Number: 22

2014-09-03     0 Comments

cloudwinds

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: helpers/time_helper.php

Line Number: 22

2014-08-29

Public Question, everyone could view answers and download attachments.

Finish this task then you can earn 15

Task Finished


>>Back to Task List


Sponsor


You may interest with



Share

Join Effecthub.com


Or Login with Your Email Address:

Or Sign Up with Your Email Address:
This field must contain a valid email
Password should be at least 1 character

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: views/footer.php

Line Number: 6

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: controllers/task.php

Line Number: 19

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: controllers/task.php

Line Number: 84