Develop PHP Website for Learning Web Design Free Online
  Home   |   Forums   |   DevCMS
  Join   |   Log In
 
   

Actionscript 3.0 Tutorials - Learn Actionscript 3.0

Tutor at Develop PHP
Built-In Core Functions and Custom Functions
By: Adam      Created: Jul 07, 2009      Views: 4301 Tweet This Page  Post page to Facebook  Post page to Facebook

Functions are the real meat and potatoes of programming in any language. Why would ActionScript 3.0 be any different. There are two types of function types in ActionScript 3.0. The built-in core functions, and user defined custom functions that we can create for any purpose.

Functions help you reuse code blocks and code logic many times. We use built-in core functions all the time and do not even realize that we are calling a function. The built-in core functions already have a process that they undergo using the built in functionality of the language. It happens behind the scenes. Custom functions we create are fed their logic and variable manipulation by us so we can view all that occurs inside the function.

Built-in core function examples


Round a decimal number using the Math.round() built-in core function
Learn HTML
var myNum:Number = 5.7;

var roundedNum:uint = Math.round(myNum);

trace(roundedNum);

Develop PHP browser display window
6

There are many built-in core functions, here we just used two. Math.round(), and trace(). We will cover many more in later sections. Now do we know what happened to those values exactly? When we passed them through the function we could imagine what took place but we cannot see it. It just performs the magic for us, and returns a new adjusted value. The people who create and add to the ActionScript 3.0 programming language add the core functions. They place lines of code that modify the variable values we send into them when called.

Custom user defined functions are much more interesting because we create them to modify variables in the way that we see fit, and more of a hands on approach to data manipulation and evaluation.
                                   Our First Simple Custom Made Function


Comment on Built-In Core Functions and Custom Functions




Search Tags:
Built-In   ·  Core   ·  Functions   ·  and   ·  Custom   ·  Functions   ·  
 
 
Arbitrary Links and Archives
Home
Active Forums
Members
SIte News
Link To Us
Gear
2009 Forum Archive
Programming Courses
Learn HTML
Learn CSS
Learn PHP
Learn MySQL
Learn Javascript
Learn jQuery
Learn ActionScript 3.0
Learn Java
Learn XML
DevelopPHP Requires Flash Player
Get Adobe Flash player
___________________________________________

Terms of Use  •  Privacy  •  Admin Notes

©2010 developphp.com   |   Powered By FlashBuildingHolder