Hello Glen

Ok, it needs to be on stage first - that's why it was null in my tests

I still wonder if it's possible to set DEBUG once as _static_ var or const?

Regards
Alex

On Wed, Jan 21, 2009 at 9:13 PM, Glen Pike <postmas...@glenpike.co.uk> wrote:
>   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;
>           }
>       }

> Alexander Farber wrote:
>> 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.
>>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to