In the previous post, we talked about ways to pass flash vars to our flex application.
In this post, we’ll discuss how to read, analyze and use them in our flex application.
Actually, it’s really quite simple.
First, let’s create a FlashVarsManager utility class that will be responsible for loading, parsing and serving flash vars. Basically, it’s a Singleton class with a parse method and getters.
Check out one implementation here (use right-click -> save as).
In your main application file (the one that has the Application tag), add a listener for the application’s creationComplete event, and in the handler put this line of code:
From that point on, you can get to the flash vars values using the FlashVarsManager getters.