Printer Friendly Version

BellaOnline's Flash and Animation Editor

ActionScript and Script Assist Button

5. Click on the Listener input field (to the right of the Type input field) and type in "replay_ecard". Flash will update our code automatically. Here is what you should have.

Now we are ready to write our function.

6. From the code list, choose Language Elements Statements, Keywords & Directives definition keyword function. As you can see, we have a not_yet_set reminder in our new code. We need to tell Flash the name of our function. Click on the Name input field and type in "replay_ecard". Flash will update our code.

7. The next input field is for Parameters. The parameter that we need to supply for this function is the mouse event. In the Parameters input field type in "event:MouseEvent".

8. Under the Parameters input field is the Type field. Use the drop-down menu to set this field to void. Your code should look like this.

9. We will now add the code that will tell Flash to go back to Frame 1 and play the animation. This will be very similar to the stop() code that we added in the previous tutorial. We will use the gotoAndPlay() code. Click on the Plus sign to open the code list. Choose flash.display MovieClip Methods gotoAndPlay. In the Object input field type in "this" to tell Flash that we are talking about the main Timeline. In the Frame input field type in "1". This will tell Flash to go back to Frame 1.

Here is the finished code.

Save the ecard. Now we can publish our eCard for the web. From the Menubar, click File Publish.

← Back

Join us in the Flash forum.

Flash and Animation Site @ BellaOnline
View This Article in Regular Layout

Content copyright © 2013 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.

| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2018 Minerva WebWorks LLC. All rights reserved.

BellaOnline Editor