This content has been marked as final. Show 3 replies
I guess I have to be one of those for whom this just works. I do not see anything wrong with the code.
What does the loaded swf look like? You need to be working with an AS3 swf to start with.
Thanks for the reply,
It is good to know that this actually does work for someone.
Maybe it needs some libraries linked in?
I use the flex commandline compiler to build this example, like this:
mxmlc -output test.swf -compiler.source-path=src/ src/MainApp.mxml
Then run the resulting test.swf file in the browser.
The window opens and shows "URI Parameters:param1:hello" with the 'Show" button on the next line.
Then clicking the Show button, it loads the same test.swf again using SWFLoader. The code uses test.swf?var1=123 as the URL. The swf loads fine, but displays "URI Parameters:".
So in this case an AS3 SWF loads the same AS3 SWF. FlashVars still don't work.
At first I tried loading an AS2 SWF. The SWF loaded and ran fine but FlashVars weren't passed in. If both are AS3 SWF's then a workaround is to set the application parameters directly. But I need this to work from AS3 loading AS2 SWF's.
So FlashVars are passed when loaded through the browser but not when loaded through SWFLoader.
# mxmlc --version: Version 2.0.1 build 155542