Start the Flash program. Click "New" from the "File" menu on the main Flash menu bar. Click the file type "Flash File(ActionScript 3.0) from the "New Document" dialog box that appears. Click the "OK" button on the lower right hand side of this dialog box to close the dialog box.
Select the "Actions" option from the "Window" menu on the main Flash menu bar to open the "Actions" editor. Position your mouse cursor on the first line of the Action's editor. Click your mouse button. Type the code below on the first line of the Actions editor to call a function named "myFunction;"
myFunction();
Press the "ENTER" key on your keyboard to move the mouse cursor to line 2 of the Actions editor.
Type the the function code for "myFunction" listed below on lines two and three on the Action's editor to make the AS3 program display the words "my first function call" when the flash movie is played.
function myFunction(): void
{trace("my first function call");}
Click the "TestMovie" option in the "Control" menu on the main Flash menu bar. Read the statement you traced, "my first function call" that appears in the "OUTPUT" display panel.
Replace the f AS3 code you typed in above with the code below in the Actions editor to call the "myFunction" function ten times and display the "my first function call" message 10 times using the "for" loop AS3 statement. Copy and paste the code below directly into the Actions editor to save time.
for (var i:int = 1; i <10; i++)
{myFunction(); }
function myFunction(): void
{trace("my first function call");}
Click the "TestMovie" option in the "Control" menu on the main Flash menu bar. Observe the statement you traced, "my first function call" is repeated 10 times in the "OUTPUT" display panel.