Flash AS3 Tutorials Center | Interesting Flash Animation Tutorials | Valuing Flash Animation Tutorials | Flash ActionScript and Animation Home

AS3 Beginner Tutorials | AS3 Basic Lessons | AS3 Valuing Courses | AS3 Components Tutorials | AS3 and PHP Interaction Tutorials
AS3 Practical Tutorials | AS3 Animation Techniques | AS3 Transition Effects Tutorials | AS3 Download Upload Files | AS3 Particle Systems
Communication Between Flash Movies with AS3 | AS3 and JavaScript interaction | AS3 Matrix Transformation | AS3 Physics Simulation Tutorials

Actionscript Most Basic Syntax of Function

Please update flash player to view this Flash ActionScript tutorial!

Flash Tutorial Content:

The most basic syntax of function is shown in the following diagram. No value is sent to the function to process. The function simply process something, for example, print out something on the screen, and no values are stored in variables and return back to the script.

basic syntax of actionscript function syntax

Flash ActionScript Codes:

// Create a custom function
// The name of function is displayMyAge
// No value is sent to the function to process
// The function will not return a value, therefore use void for the Return Data Type
function displayMyAge ():void {
// The codes below will be executed when being called or run
output_txt.text = "My age is 25";


// Run or call the function with the function name (displayMyAge)

Download Flash Source File:

Flash Source File functions-most-basic-syntax.fla


The ActionScript function above simply print out something on the Flash Movie when being called. This should be the most basic syntax of ActionScript functions.