0

I'm building my first flixel app (a flash-based game engine) and I'm having trouble accessing the FlashVars from my html source. Flixel's root element is not derived from the top-level root, and I can't get a workaround in place. I've done some research and found a few promising solution here:

http://forums.flixel.org/index.php/topic,449.msg3101.html#msg3101

however none of these solutions have worked for me. I think the magicRoot implementation is the best offered there, but I still haven't been able to get it working properly. Any help would be appreciated!!

1 Answers1

2

You can get a reference to the stage from within a Flixel game by using FlxG.stage.

Cadin
  • 4,275
  • 1
  • 14
  • 22
  • THANK YOU! this was a life saver! – noremac Nov 09 '11 at 23:22
  • What I ended up doing was putting this in my play state's constructor: var params:Object = LoaderInfo(FlxG.stage.root.loaderInfo).parameters; if(params.myParam != null) FlxG.switchState(new AnotherState(params.myParam)); And it worked like a charm! Hope this helps someone else, I had a hard time trying to figure this one out. – noremac Nov 09 '11 at 23:29