Ultrashock Forums > Flash > ActionScript
AS3 - Stage Class & AS3 Global Object

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
AS3 - Stage Class & AS3 Global Object
Old 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.
postbit arrow 1 comment | 3084 views postbit arrow Reply: with Quote   
Registered User
wormboy is offline
seperator
Posts: 60
2001-10-11
Age: 37
seperator

Ultrashock Member Comments:
Thread Tools
Display Modes Rate This Thread
Rate This Thread: