This content has been marked as final. Show 6 replies
Easiest way is to attach them as query string params:
Build the string before you load the app with the SWFLoader.
Then in the app, access them as you would flashVars variables (eg, Application.application.parameters).
Thanks for the information. I was however hoping to pass more complicated data (like XML Objects) and also wanted to avoid reloading the same SWF every time a user wants to "preview". I came across this post ...
Its a little involved however and I don't quite exactly understand all of the syntax. I also wanted to embed the swf into the app by doing something like this in the SWFLoader.
Thanks again for all your help already.
This document describes some techniques you can use to share data across apps:
It requires that you use Flex 3.0.2 (the latest release), but hopefully it will give you some ideas.
Thanks so much for this resource!
Hey Matt -
One for follow up question. That document seems to have the solution I am looking for with the sample app on page 24.
However, the sample app assumes that the sub-app was compiled with the flex framework (I think), hence the reason for the ".application" in the following line.
var subApp:SubApp2 =
(contentLoader.content as SystemManager).application as SubApp2;
I got the example to work properly "as is", but was unsuccessful when I attempted to use an SWF that was built without the Flex framework (just compiled in Flash).
What if the sub-app was not compiled with the Flex framework?
Thanks in advance,
Just wanted to help out those looking for an answer to any similar problems (passing data to a flash swf loaded in by SWFLoader). I found this great simple way to perform this task ....