Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-12-2012, 01:16 PM   #1
Damo12
Registered User
 
Join Date: May 2012
Posts: 2
Question Accessing variables from another scene - _root (AS2) won't work anymore

I needed to access variables from different scenes in AS2 and found that '_root.variable' worked a treat.

For example:

_root.var0 ;
var0 = 64 ;

This isn't working in AS3. Any suggestions?
Damo12 is offline   Reply With Quote
Old 05-12-2012, 03:25 PM   #2
Biodiscus
Immma firing Ninnnnjaaa
 
Join Date: Aug 2011
Posts: 95
Default

Quote:
Originally Posted by Damo12 View Post
I needed to access variables from different scenes in AS2 and found that '_root.variable' worked a treat.

For example:

_root.var0 ;
var0 = 64 ;

This isn't working in AS3. Any suggestions?
In as2 you did not get variables from another scene with _root. You did that with _global. And in AS3 every variable is global
Biodiscus is offline   Reply With Quote
Old 05-12-2012, 04:30 PM   #3
Damo12
Registered User
 
Join Date: May 2012
Posts: 2
Default

OK! So, this will result in a root variable then...
var var0 ;
var0 = 64 ;
...accessible from any scene?
Great! Thnx!
Damo12 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:08 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.