Difference between revisions of "Actionscript"

From Wikicliki
Jump to: navigation, search
(Operators)
(Operators)
Line 2: Line 2:
 
=== Operators ===
 
=== Operators ===
  
+ add
+
* + add
- subtract
+
* - subtract
* multiple
+
* asterisk multiple
/ divide
+
* / divide
  
<code>myNum = myNum + 6;</code> IS THE SAME AS  
+
<code>myNum = myNum + 6;</code>  
 +
IS THE SAME AS  
 
<code>myNum += 6;</code>
 
<code>myNum += 6;</code>
  

Revision as of 13:00, 22 September 2008

Basics

Operators

  • + add
  • - subtract
  • asterisk multiple
  • / divide

myNum = myNum + 6; IS THE SAME AS myNum += 6;

Conditionals

var message = "yellow";                         // the equal sign assigns values to variables
trace ("big " + message + " truck");            // prints "big yellow truck"
if (message == "yellow") {                      // the double equal sign checks to see if variables are equal
trace ("yes, i did say big yellow truck.");     // prints "yes, i did say big yellow truck"
trace (typeof message);                         // prints "string"
var x = a;                                      // prints "number"
trace (typeof a)
}
var x = 1;
while (x <= 5) {                // as long as x is less than 5...
trace (x);                      // return 1 in output
x = x + 1;                      // return 2 3 4 5 in output
}

Reusable functions

Runtime Environment

Detecting player/OS

Setting movie dimensions

Color

Setting RGB

Setting Transparency

Transform and restore RGB

Controlling RGB with sliders

Drawing

Numbers

Rounding Numbers

Text Field

Arrays

Oh no.

Strings

Date/Time