Skip to main content
June 15, 2007
Answered

_global in AS3 ...

  • June 15, 2007
  • 4 replies
  • 637 views
Hi everyone,
i'm working with Flash CS3 and i'm doing an application with AS3.
right, i need use a global variable and i have problem with this..

in AS2 i just do it: _global.var = "hello world";

but readind Flash Help i see that function is REMOVED!
anybady know how i do it? for declaring a global veriable?

sorry for my english, i'm from Brazil.

Hugs!
This topic has been closed for replies.
Correct answer attachMovieClip
I think this is what you are looking for.

P.S. you will need to drag the textArea component onto the stage then delete it for it to work.

4 replies

July 2, 2007
Hey attachMovieClip,
thanks a lot man..

hugs!
June 29, 2007
ok Klad
i do a package..

package
{
import flash.display.*;
public class ActionWebfire extends Sprite
{
public static var NomeVideo:String = "oi";
public function ActionWebfire() {
trace(NomeVideo);
}
}
}

and works.

but, i want show the value of "NameVideo" in a textfild... and i can't do it..
how i can do ti?
i need to declare a Object like something this:

var NewName:ActionWebfire = new ActionWebfire();

??

i'm lost!

hugs!

attachMovieClipCorrect answer
Participant
June 30, 2007
I think this is what you are looking for.

P.S. you will need to drag the textArea component onto the stage then delete it for it to work.
June 19, 2007
Ok, kglad.
Thanks for your help.
but whem i use: glo.bal.HELLO = "oi";
in output panel show me this error: 1120: Access of undefined property glo.
i have to import something? or i need do it:

class glo {
puclic var OI:String;
}

my time is over.. i need more help.

Hugs!
kglad
Community Expert
Community Expert
June 19, 2007
classes need to be in packages in cs3 and should be in the correct path/directory for you fla to find:



kglad
Community Expert
Community Expert
June 15, 2007
you can use a public class (named glo) with a static object (bal). then

glo.bal.whatever will be available everywhere in your swf that has access to the glo class.