ActionScript and Script Assist Button
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.
Copyright 2018 Adobe Systems Incorporated. All rights reserved. Adobe product screen shot(s) reprinted with permission from Adobe Systems Incorporated. Adobe, Photoshop, Photoshop Album, Photoshop Elements, Illustrator, InDesign, GoLive, Acrobat, Cue, Premiere Pro, Premiere Elements, Bridge, After Effects, InCopy, Dreamweaver, Flash, ActionScript, Fireworks, Contribute, Captivate, Flash Catalyst and Flash Paper is/are either [a] registered trademark[s] or a trademark[s] of Adobe Systems Incorporated in the United States and/or other countries.
Editor's Picks Articles
Top Ten Articles
Content copyright © 2018 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.