Home > Uncategorized > Global variable in as3

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
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.