Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether.

Similar presentations


Presentation on theme: "1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether."— Presentation transcript:

1 1 Flash Actionscript Adding Interactive Actions

2 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether your applications are simple animated movies or more complex rich Internet applications. You don't have to use ActionScript to use Flash, but if you want to provide basic or complex user interactivity, work with objects other than those built into Flash (such as buttons and movie clips), or otherwise turn a SWF file into a more robust user experience, you'll probably want to use it.

3 3 Adding an Interactive Action Start a new movie with File -> New Create a blue circle, put it in the centre of the stage, and convert it to a movie clip symbol. Call the symbol circle_mc. With the circle still selected use the properties’ panel to give this instance of circle the name ball.

4 4 Adding an Interactive Action So we have a symbol called circle_mc with an instance of this symbol called ball. Now create a new layer and call it actions. Add a keyframe to the actions layer at frame 2 and add a new frame to the other layer (this is so that the first layer has two frames). We will then add actions to both of the frames on the actions layer.

5 5 Adding an Interactive Action Call up the Frame Actions window for frame 1 of the actions layer (right click on frame 1 and select actions). Make sure Script Assist is turned off. Type the following into the actions window this.ball.x = mouseX; this.ball.y = mouseY;

6 6 Adding an Interactive Action Put the following action into the Frame Actions window for frame 2 of the actions layer. gotoAndPlay (1); The second action means that the animation simply loops from 1 to 2 indefinitely.

7 7 Adding an Interactive Action this.ball.x = mouseX ; What does this mean? this is used to target the current timeline mouseX is the Flash way of referring to the current x coordinate of the mouse ball is the name we gave to the current instance of the circle symbol. x is the horizontal position property of that instance which we are assigning to the current value of the x position of the mouse.

8 8 Adding an Interactive Action We are doing the same with the value of the y and hence the blue ball will simply follow the mouse around the screen when we run the animation.


Download ppt "1 Flash Actionscript Adding Interactive Actions. 2 ActionScript 3.0 ActionScript is the language you use to add interactivity to Flash applications, whether."

Similar presentations


Ads by Google