Jump to content
Search Community

Reload SWF

alflasy test
Moderator Tag

Recommended Posts

Hi,

Is there any better way to reload the swf which already displayed.

So why I want to that? 

Let me explain, if the user is on slide 5 which is a child SWF with animation and I have a refresh button on parent Menu. So when the user clicks the refresh button I want to reload that same child SWF with new variables that user have set on its parent.

 

Any idea?

Thanks

Link to comment
Share on other sites

 

Is there any better way to reload the swf which already displayed.

 

I don't know how you are currently re-loading, so its tough to suggest a better way. If you simply need the variables to be used to update certain aspects of the swf, no, I wouldn't reload it.

 

I would create a function in the loaded swf that accepts those new variables and takes the appropriate action with them.

 

perhaps the user specifiies that a circle should be red, the parent swf can call a function on the loaded swf like so:

 

 

 

mySWFLoader.rawContent.updateCircleColor(0xff0000);
 

 

 

and then the loaded swf would have a method

 

 

 

function updateCircleColor(color:uint):void{
TweenMax.to(circle_mc, 1, {tint:color});
}
 

 

 

I don't know exactly what you are doing so that's as detailed as I can get.

 

If you need to reload the SWFLoader, just use the load() method and pass in true as the flushContent parameter like so:

 

 

 

mySWFLoader.load(true);
 
Link to comment
Share on other sites

I think  it for me

mySWFLoader.load(true);

But, it reloads all the slides and keeps the existing ones

Like if I have 10 slides in the SWF then after running mySWFLoader.load(true) it add 10 more so then I get 20 slide. 

Now how can I clear the existing slide and then run load(true)

 

Its amazing how quickly it loads the relaods the slides. Great LoaderMax!!!

 

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...