3

I want to access some flashvars in my preloader to a Flex application. How is this possible?

Regards Adlertz

3 Answers3

4

Try the loaderInfo.parameters attribute of the preloader.

David Hanak
  • 10,754
  • 3
  • 31
  • 39
1

From the preloader, you should be able to access the flashvars indirectly through the SystemManager as follows:

var systemManager:SystemManager = parent.parent as SystemManager;
var params:Object = LoaderInfo(systemManager.loaderInfo).parameters;
Raul Agrait
  • 5,938
  • 6
  • 49
  • 72
  • I think the loaderInfo attribute of all sprites in the display tree point to the same LoaderInfo instance, so there is no need to dig up the system manager. But I could be wrong. – David Hanak Mar 25 '09 at 09:16
0

I have accessed the flashvars using loaderinfo from the root of my preloader-sprite.

var flashvars:Object = root.loaderInfo.parameters;

The tricky part was to know when the root wasn't null. But I found a blogpost:

http://dndigital.net/blog/2008/08/accessing-flashvars-in-a-custom-flex-preloader/