|
|
|
|

#1 |
AS3 - Stage Class & AS3 Global Object
2008-01-29
I am a bit new to AS3...
I am planning to build a base.swf which dynamically loads in the core_yyyymmdd.swf. (The filename is pulled from a dynamic source - this all works fine).
The trouble I'm having is that I can't seem to access the Stage Class from the newly loaded swf's document class. Is this only possible in the very first swf/movieclip that is loaded - or am I just having scoping issues?
I am also trying to implement Uza's AS3 Global Object to help with these sort of issues.
Uza’s Blog & More » AS3 Global Object
Code:
package {
import lt.uza.utils.*;
import flash.display.Sprite;
public class BaseDocument extends Sprite {
private static const WEBDOMAIN = 'http://www.domain.com/';
private var global:Global;
public function BaseDocument() {
global = Global.getInstance();
global.myStage = this.stage;
global.WEBDOMAIN = WEBDOMAIN;
}
}
}
Again I can only seem to access the global properties from the base.swf classes and not from the new core_yyyymmdd.swf classes.
I realise this is probably fundamental basic AS3 knowledge - but I am scratching my head. Any pointers would be much appreciated.
|
|
|
|
|
|
|
|
|
Registered User
|
|
|
Posts: 60
2001-10-11
Age: 37
|
|
|
|
|
|
|
|
|
|
Ultrashock Member Comments:
http://brianchau.wordpress.com/2008/...tage-or-stage/
http://www.iheartactionscript.com/st...ntroot-in-as3/