Hi,
I think you can use this.stage.loaderInfo, but your Sprite needs to
be on stage before you can use the stage parameter.
For example:
private function _addedToStageHandler(event:Event):void {
trace("BackgroundAudio::_addedToStageHandler " +
this.stage.loaderInfo.url);
if (!_inited) {
var _url:String = this.stage.loaderInfo.url;
if ( -1 != _url.indexOf("file://")) {
_path = "." + _path;
}
_inited = true;
}
}
HTH
Glen
Alexander Farber wrote:
Hello flash coders,
in my document class I check loaderInfo.parameters.debug:
public class MyGame extends Sprite {
public static const DEBUG:Boolean = loaderInfo.parameters.debug;
public static const SERVER:String = DEBUG ? 'http://192.168.111.43' :
'http://preferans.de';
public static const INTERVAL:uint = (DEBUG ? 60 : 15) * 1000;
and this way I can switch on debugging mode in my game
by loading MyGame.swf?debug=1 in the browser tab.
But how can I access the loaderInfo.parameters.debug
from other custom MovieClips/Sprites in my application?
I do not want to check for MyGame.DEBUG, because
I'm trying to keep the code in separate "modules" -
i.e. I have for example files User.as and UserTest.fla
and can compile and test that class without the MyGame.as
Regards
Alex
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
--
Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders