The enumerated variable for... in is the subscript in the array.
For each .. In traverses elements in the array.
VaR books: Object = {"hello", "Judy", "Wong", "Star" };< br/> for (var k in books) {<br/> trace (Books [k]); <br/>}< br/> for each (VAR m in books) {<br/> trace (m ); <br/>}
Simple judgment
Which is a little different from the switch statement in Java?
The case statement in the swtich () statement can be of the string type...
Ii. Function Learning
As functions are divided into two types: method and function closure ).
Function Name (parameter 1: parameter type, parameter 2: parameter type): return value {
// Internal function statements.
}
Different Java
Public Return Value Function Name (parameter type: parameter 1, parameter type: parameter 2 ){
}
In flash
1. functions can proxy function objects.
VaR kfunc: function; <br/> var sex: String = "man"; </P> <p> If (sex = "man ") {<br/> kfunc = manfunc; // equivalent to the address at which kfunc points to manfunc. <Br/>}< br/> funtion manfunc (): void {<br/>}
This method is available in C and C ++ and seems to have been useful in Java.
2. Create a function queue
VaR F: array = new array (); <br/> F. push (afunc); <br/> F. push (bfunc); <br/> F. push (cfunc); <br/> function afunc () {<br/>}< br/> function bfunc () {<br/>}< br/> fuction cfunc () {<br/>}< br/>
3. Flash = good judgment
Whether you use = for the address or content, the difference with Java is that you use the equeas () method to compare the content in Java.