5. Pelbagai jenis animasi dapat dihasilkan dengan pengunaan ActionScript. Pengunaan ActionScript tidak melibatkan banyak pengunaan grafik. Apa yang dilakukan di sini ialah memaklumkan tindakan (Action) yang perlu dilaksanakan bagi sesuatu peristiwa (event) itu berlaku. ActionScript membenarkan pengguna untuk mereka movie interaktif yang dimainkan dalam turutan nonlinear dan respon terhadap input pengguna daripada keyboard atau mouse.
6. Mengapa Perlu Belajar ActionScript? Selain mengetahui kod disebalik Flash, ActionScript juga berguna di dalam membangunkan aplikasi interaktif tambahan terhadap movie yang dibina atau menggerakkan objek dari satu kedudukan ke kedudukan lain.
7. Bagaimana Menulis ActionScript? Menulis ActionScript adalah tidak lain daripada menulis arahan. Setiap arahan yang dimasukkan memaklumkan kepada Flash untuk melakukan sesuatu secara spesifik. Contohnya, “play”, “stop”, “or” dan sebagainya. Dengan menentukan arahan bagi setiap baris ActionScript secara spesifik, membenarkan pengguna mencantumkan dan menghasilkan arahan yang lebih baik. Tetapi harus di ingati bahawa setiap “sentence”( baris kod) merupakan arahan yang tunggal.
8. ActionScript berasaskan masaialah apabila arahan actionscript dimasukkan pada frame. Action yang diarahkan akan dimainkan apabila playhead sampai pada frame yang mengandungi action. ActionScript berasaskan penggunaberlaku apabila butang action mengandungi arahan actionscript . Action yang diarahkan pada butang dimainkan apabila pengguna memberi input, biasanya dalam bentuk mouse event
9.
10.
11. 11 gotoAndPlay This frame action sends the playhead to the specified frame in a scene and plays from that frame. If no scene is specified, the playhead goes to the specified frame in the current scene.
13. 13 getVersion Returns the Flash Player version number and operating system information. You can use this function to determine whether the Flash Player that is in use can handle your Actionscript.
14. 14 Properties All available information about an object You can use ActionScript to read and modify object properties All property names begin with an underscore (e.g., _visible)
15. 15 _visible = false This property make an object invisible Assign the following action to a button… On (release) { _visible = false; } Button disappears on mouse click
16. 16 Method Similar to actions in that they effect objects Built into objects Invoked (Executed) through dot notation
18. 18 Variables hold data for use in your Flash movies Variables can hold any type of data You could store: User name Result of calculation True or false value
19. 19 Expressions An expression is any statement that Flash can evaluate and that returns a value. You can create an expression by combining operators and values or by calling a function.
20. 20 Operators Expressions use operators to tell Flash how to manipulate the values in the expression. They are the commands that say “add these values” or “multiply these numbers”
21. 21 Some types of operators Assignment: are used to assign values to variables. The most common is (=). It makes the variable on the left equal to the value of the variable or expression on the right. Comparison and equivalence: (<), (>), (< =) Numeric: perform mathematical operations on values
22. 22 Looping When you need to repeat certain actions in your movies more than once. Makes coding more efficient, using the same set of commands as many times as necessary to complete a task.
23. 23 Looping examples while Creates a loop that continues to repeat as long as a condition remains true for Creates a loop that executes a specific number of times using a counter for…in Creates a loop that executes once for each member of a group of objects (class) This makes certain that the entire group of objects is processed in the same way
24. 24 Hints Before you begin writing scripts, formulate your goal and understand what you want to achieve. Planning your scripts is as important as developing storyboards for your work. Start by writing out what you want to happen in the movie, as in this example: I want to create my whole site using Flash. Site visitors will be asked for their name, which will be reused in messages throughout the site. The site will have a draggable navigation bar with buttons that link to each section of the site. When a navigation button is clicked, the new section will fade in at the center of the Stage. One scene will have a contact form with the user's name already filled in.