0
votes

I wrote a simple flash loader that loads external swf and then calls javascript function to show div containing flash. I need to pass flashvars to loaded swf. I have read that I just need to use query string when loading to pass variables: externalswf.swf?var1=val1&var2=val2

BUT there is a problem. External swf can be very big and I'd like it to be cached by flash engine. It seems it's impossible in case of url parameters ?var1=&var2=& because those vars often change. Is there other ways to pass vars into inner swf. (I cannot change inner swf and I know only one thing - it use vars passed via flashvars mechanism)

Thanks

2

2 Answers

0
votes

I assume you set the parameters in the Flash loader. If that is the case, and also assuming you jhave control over the creation of the loaded swf...

Why don't you just load the swf without any parameters, then pass those parameters to the loaded swf with a function. You could add a "setParameter" function to each swf that you want to load and use that to set parameters after loading it.

Unfortunately, the LoaderInfo.parameters value is read only and therefore cannot be used for setting after loading. So the last suggestion is the only way I see here. Should you have no control over the creation of the loaded swf, I am out of ideas here. :(

0
votes

I don't see what's wrong with passing variables to the child swf by exposing a function inside the child class itself. Should be easy enough. Besides, you probably want to keep the Flash vars reading from the parent class and delegate accordingly. That would be my practice.