Jump to content
Search Community

SWF Loader doesn't Re-Load when I come back to the keyframed section

ngrinchenko test
Moderator Tag

Recommended Posts

My website is arranged in a way that I have main time line segmented into labeled sections by the key frames. Each section has its own unigue elements. Background has elements which are common for all the sections. One of these common elements is an SWF loader which loads an animation running in the background. I applied the loader code on the first frames of a section thinking that since it is running in the background I do not have to apply the code on every single set of keyframes. It works if I go from section to section which has this loader present.

However there are pop up windows in other labeled sections which do not have this loader. If I come back from these sections then I do not have a loaded SWF on the screen. I have a container mc for the SWF Loader on the screen which supposed to be set to visible = false; but it is visible on the screen and there is no loaded animation.

 

Here is my code for the loader:

 

///loader_appLoaderHOME////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////

///////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

//this hides the background in the MC container, allowing it to be present on the working screen but not live

holderMC_MovingLights.holderMC_applicationsBckgrnd.visible = false;

 

TweenMax.to(progressBar_MovingLightsLoader_mc, 0, {blurFilter:{blurX:20, blurY:11}});

//makes sure that none of the barPopUp_mc is showing

progressBar_MovingLightsLoader_mc.gradientbar_appLoader_mcPopUp_mc.scaleX = 0;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////

 

var loader_MovingLights:SWFLoader;

 

if (loader_MovingLights){

if(loader_MovingLights.content){

loader_MovingLights.unload();

}

}

 

loader_MovingLights = new SWFLoader("supporting files/building blocks/updated/movingLights_Pentagrams.swf",

{

estimatedBytes:1500000,

container:holderMC_MovingLights,// more convinient and easier to manage if to place the LoaderMax into an empty mc (holderMovieClip)

// if not will work as well. Then the line container:holderMovieClip, has to be replaced with container:this,

// can be any size, can not be scaled as it distorts the content

onprogress:progressHandler_loaderMovingLights,

onComplete:completeHandler_loaderMovingLights,

centerRegistration:true,

alpha:1,

scaleMode:"none"

});

 

function progressHandler_loaderMovingLights(event:LoaderEvent):void{

progressBar_MovingLightsLoader_mc.gradientbar_appLoader_mcPopUp_mc.scaleX = loader_MovingLights.progress;

}

 

function completeHandler_loaderMovingLights(event:LoaderEvent):void{

var loader_MovingLights:ContentDisplay = event.target.content;

TweenMax.to(progressBar_MovingLightsLoader_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});

holderMC_MovingLights.visible = true;

}

 

loader_MovingLights.load(true);

Link to comment
Share on other sites

It's very difficult to diagnose this problem from the code shown.

This sounds like there is a problem related to how your code and assets are placed on multiple frames of the movie and not really related to how SWFLoader works.

 

At the very least you should be putting trace() statements in each function to ascertain which functions and callbacks are running and those that are not.

 

For instance

 

 

function completeHandler_loaderMovingLights(event:LoaderEvent):void{
var loader_MovingLights:ContentDisplay = event.target.content;
TweenMax.to(progressBar_MovingLightsLoader_mc, 1.5, {alpha:0, scaleX:0.25, scaleY:0.25});
holderMC_MovingLights.visible = true;
trace("completeHandler() fired");
}

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...