Global variable in as3
in as2 when we going to use a global variable we just write _globl before the variable.
however in as3 due to it become OOP in writing style we have to follow it. that’s mean we can’t do that anymore
instead we create a class and then declare a variable inside it. since class can be access from anywhere.
for examlpe:
public class global
{
public var gv: string;
}
after that we can use it on anywhere to calling the class and it variable global.gv = “as3 is nice”;
Advertisement
Categories: Uncategorized