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
Operators
By: Adam      Created: Jul 07, 2009      Views: 4425 Tweet This Page  Post page to Facebook  Post page to Facebook

Operators are used to compare and evaluate variables and expressions in our code. Operators play a very important part in programming. Without them not much would get done automatically. In the following example we use the ( == ) operator to check if a variable is equal to our literal value.
Learn HTML
var myName:String = "Adam";

trace(myName == "Joe"); // Returns value of false

Some operators take precedence over others even if the other is the first expression, demonstrated here.
Learn HTML
var equation:uint = 4 + 1 * 5; 

trace(equation); // output  is 9 not 25, multiplication performs first

Reference Chart for Commonly Used Operators in Actionscript 3.0
Operator Operation
= The assignment operator. Used primarily to place values into variables.
++ Increments a value. If placed in front of variable name, it increments then returns value. If placed after the variable it returns the value of variable first then increments.
-- Decrements a value. If placed in front of variable name, it decrements then returns value. If placed after the variable it returns the value of variable first then decrements.
+ Addition on numbers and combining of strings.
- Subtraction on numbers, and defines a negative value.
* Multiplication
/ Division
% Modulo
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
== Equal
!= Not equal
=== Strict equality
!== Strict inequality
&& Logical AND
|| Logical OR
?: Conditional

                                   Object Properties and Methods


Comment on Operators




Search Tags:
Operators   ·  
 
 
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