This page require Adobe Flash 9.0 (or higher) plug in.

ActionScript 3 : Where’s the _root?

Where is those _root.VariableName in ActionScript 3.0?

Good question, well _root is still there, but in ActionScript 3 is usually replaced with stage.variable_name, stage.objectname or MovieClip(”name”) commands.

A neat way to make a reference to _root is as follow. E.g. calling a _root variable called score and update it to 10.

1
2
//Accessing _root variables and object names in Actionscript 3.0
MovieClip("root").score += 10;

Other Cool Related Stuff

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: