flash: why use "var"?
flash: why use "var"?
Out of context: Reply #10
- Started
- Last post
- 13 Responses
- subaddiction0
It is used for local variables. put this in your timeline:
test =function(){
var testme="good"
trace (testme);
}
test();
trace (testme);and youll get:
good
undefineduse this
function test =function(){
this.testme="good"
trace (testme);
}
test();
trace (testme)
then you'll get
good
goodAnd it would works just the name using:
function test(){
var testme="good"
trace (testme);
}
test();
trace (testme);or
function test(){
testme="good"
trace (testme);
}
test();
trace (testme);