Jump to content
Search Community

SWFLoading Lock - issue with loaded swf animation lock

ChzBoi test
Moderator Tag

Recommended Posts

Hello GS folks.

 

I would like to do the following: Create 2 loading queues. In Q1, load a small external swf that will loop a few frames (say like an "hourglass") to show loading is proceeding. In Q2, I would load a larger external swf in the background. Simple. However, as I've been trying this, my "hourglass" animation will lock/freeze until the Q2 has finished loading. Also, the entire Flash IDE will lock.

 

I've made a very simple xml and script to test this.

XML:

<?xml version="1.0" encoding="iso-8859-1"?>







 

SCRIPT:

import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.*;
import com.greensock.loading.display.*;
import com.greensock.plugins.*;

//
LoaderMax.activate([imageLoader, SWFLoader, VideoLoader]);
var loader:XMLLoader = new XMLLoader("data.xml", {name:"xmlData",onComplete:completeHandler});
loader.load();
//
var TT:Timer = new Timer(2000, 1);
TT.addEventListener("timer", TT_LoadQueue);
//
//var queue2:LoaderMax;
var Queue:LoaderMax = new LoaderMax({name:"Queue", onComplete:QUEUEcompleteHandler});
var Queue2:LoaderMax = new LoaderMax({name:"Queue2", onComplete:QUEUE2completeHandler});
//
function completeHandler(event:LoaderEvent):void {
trace("XML and queue1 loaded! "+ LoaderMax.getContent("xmlData"));	
Queue.append(new SWFLoader("assets/SmSWF.swf", {name:"hourglass"}));	
Queue.load();
       //start a timer to make sure hourglass is actually playing	
TT.start();
}

function TT_LoadQueue(event:TimerEvent) {
trace("TT_LoadQueue");
Queue2.append(new SWFLoader("assets/BigSWF.swf", {name:"base"}));
Queue2.load();
}
//
function QUEUEcompleteHandler(event:LoaderEvent):void {
trace("QUEUEcompleteHandler complete");
var HourGlass:ContentDisplay = LoaderMax.getContent("hourglass");
addChild(HourGlass);
 	trace(event.target + " is complete!");
}
function QUEUE2completeHandler(event:LoaderEvent):void {
trace("QUEUE2completeHandler complete");
var BASE:ContentDisplay = LoaderMax.getContent("base");
addChild(BASE);
 	trace(event.target + " is complete!");
}

(All you need is an asset folder with 2 swfs in it - I am using a 1MB file for the "hourglass" and a 12MB for the "base")

(I also had the progressHandlers in there, but the traces would not show up either, due to the Flash IDE lock.)

 

I've double-checked to make sure my swfs are AS3 files and looked over the LoaderMax docs for a prop I might be missing.

There is probably a very simple answer to this; something I've overlooked in haste.

 

Any advice/comments are welcome. Many thanks - Cheeze

Link to comment
Share on other sites

i'm suspecting it could have something to do with your 12mb file.

 

I am getting lost with why you are loading an xml file and then seem to hardcode the urls of the swfs into your script.

 

It would be a tremendous help if you were to upload your files. please replace the 1mb and 12mb files with very very small and light-weight swfs.

 

we would love to help you figure out the issues.

Link to comment
Share on other sites

i'm suspecting it could have something to do with your 12mb file.

 

I am getting lost with why you are loading an xml file and then seem to hardcode the urls of the swfs into your script.

 

It would be a tremendous help if you were to upload your files. please replace the 1mb and 12mb files with very very small and light-weight swfs.

 

we would love to help you figure out the issues.

 

Thank you for the reply Carl!

 

I hardcoded the urls in an attempt to remove the xml for the chain - to see if that resolved the issue.

 

I know small files work fine - any lock/delay happens much too fast to notice. In the end, the larger files are what I would need to work with.

 

Regarding an upload of files, the above AS3 code is all there is. Not sure if you want my 1mb and 12mb files: they are a 10 frame, 130x130 png sequence and a 60 frame, 800x600 png sequence (respectively) - no code on either.

 

I should say this, I was able to do this in AS2. So I must be missing something really simple! (can't see the forest for the trees)

Link to comment
Share on other sites

hmm, if it works with smaller files, that makes me think the bigger files are in fact the issue.

Why don't you do a test and cut the 12mb file down to 3mb?

 

if the problem still persists you can upload your files (trim out all code related to the xml) to a service like http://www.ge.tt/

 

and I will take a look at them. If I can't replicate the problem (using my own small files) I am not going to be able to find a solution.

 

thanks

Link to comment
Share on other sites

hmm, if it works with smaller files, that makes me think the bigger files are in fact the issue.

Why don't you do a test and cut the 12mb file down to 3mb?

 

if the problem still persists you can upload your files (trim out all code related to the xml) to a service like http://www.ge.tt/

 

and I will take a look at them. If I can't replicate the problem (using my own small files) I am not going to be able to find a solution.

 

thanks

 

Hello again Mr. Schooff - thanks for the reply!

 

Yes, using smaller sized external swfs will lessen the 'lockup' time. At around 4MB is when I start to notice it on a single file.

 

I've attached a zip file, which has my test fla and the 'hourglass' swf. All you would need is an external "BigSWF2.swf" of 4+MB to complete. [if you want my full files, I uploaded another zip 12MB in total ("_TEST_FULL.zip") to http://www.fungistudios.com/LoaderMax/_TEST_FULL.zip]

 

All I want is for the 1st loaded swf to continue to loop through it's animation once the 2nd loader starts loading the bigger swf. I must be missing some flag/var somewhere!

 

Thank you again for help!! Cheeze

Link to comment
Share on other sites

it appears your file is just so big that it is choking the Flash Player used for previews in the Flash IDE.

 

I tested with a small file, no problem. I tested with an 8mb file and saw the lock up.

 

the good news is that if you open Test1.swf in the standalone flash player or preview in a web browser there is no lockup.

 

don't trust the Flash Pro "test - movie" preview as it performs much worse than the other players/plugins.

Link to comment
Share on other sites

it appears your file is just so big that it is choking the Flash Player used for previews in the Flash IDE.

 

I tested with a small file, no problem. I tested with an 8mb file and saw the lock up.

 

the good news is that if you open Test1.swf in the standalone flash player or preview in a web browser there is no lockup.

 

don't trust the Flash Pro "test - movie" preview as it performs much worse than the other players/plugins.

 

 

I still get the lockup, not as severe, in the standalone as well as FireFox and IE. I think my fix will be to put in timers between large external swf loads, so it will appear that the 'hourglass' is moving - just only between the large files. (NOTE: this is for an self contained application and not for the web, so I am not that concerned about large files - it will all be local.)

 

Thank you for looking into this for me. If you hear of a better way to load large ext swfs, let me know! Cheeze

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