Jump to content
Search Community

SWFLoader jamming only in Flash Player.

bensbury test
Moderator Tag

Recommended Posts

Hi,

 

I'm bewildered by this and it is going to be tough to explain.

 

I am loading in some images and an swf from a dynamic source.

Everything works perfectly in the IDE but not when I upload it.

 

If I remove the swf from the loading list online, everything works fine.

So something in the swf is causing mischief.

I have loaded it individually and with LoaderMax.parse(), so that isn't causing the problem.

 

I can load everything in if I specify all the parameters (x,y,alpha etc) in the loader and it shows.

But if I load for example, the content in with 0 alpha and then try to fade in once everything is loaded it fails.

 

However, remove the swf and everything works.

It is as if the reference to the swf doesn't have the properties and so fails.

 

I loaded the queue and noticed when I put the swf in front of the images, the images failed to respond to alpha etc after loading.

If I put the swf after the queue they would load, so would the swf but it would fail to animate.

 

The code I am using is pretty simple, and works in Dev.

This is just one version of a few different ways I have tried to handle it.

My plan was to wrap the loaded content in a Movie wrapper and then just animate that. However it totally fails.

 

Here's the code...

 


private function loadContent() {

		var queue:LoaderMax = new LoaderMax({ name:"mainQueue", onChildComplete: cComplete, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});

                       var cnt = infoObj.count;  // This object holds the CMS information

                      // In this version I tried to set up containers first and manipulate them as wrappers
		while (cnt -- ) {
		infoObj[cnt].Media = new MovieClip();
		cHolder.addChild(infoObj[cnt].Media);
		infoObj[cnt].Media.alpha = 0;
		infoObj[cnt].Media.visible = true;
		infoObj[cnt].Media.y = infoObj[cnt].yPos;

queue.append(LoaderMax.parse(infoObj[cnt].Content, {container:this, alpha:1, visible:true, name:cnt, estimatedBytes: infoObj[cnt].ContentSize, centerRegistration:true}));
		}
		//begin loading
		queue.load();

	}

	private function cComplete(e:LoaderEvent):void {

                      // This version was a forced attempt to get the content into the MovieClip

		var c;
		var i = e.target.name;
		c = infoObj[i];
		c.Media = LoaderMax.getContent(i);
		cHolder.addChild(LoaderMax.getContent(i));
	}

	private function completeHandler(event:LoaderEvent):void {

		var i = infoObj.count;
		var c;

                      // I don't need the loop for this, but any attempt to affect the Wrapper will fail
                     // I've tried it going fresh for getContent(i) too and it fails.
		while(i--) {
			c = infoObj[i];
			c.Media.y = c.yPos;
			TweenMax.to(c.Media, 2, {alpha:1, x:c.xPos});
		}

		cHolder.x = (stage.stageWidth / 2); 

	}

 

This code and variations all work in the IDE.

It just goes to pot when an SWF is introduced and an attempt to manipulate it happens after it has loaded.

I have the added to stage listener going and tried a delay on any manipulations too but it had no effect.

 

Something about the SWF (maybe) is jamming the movie when I try to reference it.

The swf for test purposes is just a black square right now.

 

If anyone has any ideas or has had the same problem I'd be really grateful to hear form you.

 

Thanks,

Ben.

Link to comment
Share on other sites

Please post a sample FLA that clearly demonstrates the problem (include all necessary support files). This doesn't need to be your production files - the simpler the better. Even if it's just a blank FLA, one ActionScript file, an image, and a black box swf. It's very difficult to troubleshoot blind, so having an FLA that I can publish and experiment with myself is a HUGE help.

 

Are you loading your swf from another domain? Do you have a crossdomain.xml file in place?

Link to comment
Share on other sites

Hi,

 

I'll try and make a demo .fla

 

Partly tricky as the thing is locked into the CMS.

What I discovered is that the SWF is not loading.... or not calling the load complete handler.

 

So if you check the child progress everything loads except the SWF.

The SWF does load however because it appears and runs, but it doesn't trip the child complete or Load completed handlers.

 

I think it might have something to do with how I am setting the estimated bytes or something fruity over the CMS.

It is strange because it works fine in the IDE.

 

I have cross-domain set up, but it is on the same domain.

I did the allow scripts, added the security and error handlers and other security things too but it didn't change anything.

 

I have a few things to try out after a night's sleep, but if that fails I'll try and send a demo package that does the fail.

I was concerned the above code was screwy, but if not then I can investigate further.

Link to comment
Share on other sites

Hi Jack,

 

What I discovered was this:

 

If the swf being loaded is under 65kb (about) the swf fails to trip its own child load and thus loadCompleted events.

This was stopping my fade in etc actions on loadCompleted.

 

When I used other swf it worked.

So I made new test swf which failed (because my test was a small object).

When I boosted the file size of the swf, the loader would load as normal.

 

The tripping point is somewhere between 65kb - 70kb in this case.

 

I'll try to replicate it locally but it might be a CMS thing or who knows?

 

-------

 

Okay... this is power weird, so I'll email you the test files and also where you can see it being screwy.

 

Basically it happens only in FF (3.6.8) and only on the server I am using which might make it hard to test :)

It works on a different server.

One theory is that for whatever reason the server is too fast or something.

On an activity graph the space between it hitting the cache and loading the file is very close.

 

Also reducing the max-connections to 1, bomb the loader completely and it jams at 50% progress, although this could be where the swf is loaded in the queue.

 

-----

 

When I emailed about this I didn't know if it was a loaderMax issue or not because the problem seems so rare.

However when I loaded the swf with my own easyloader, it loaded without trouble.

 

So unless someone can find the solution here, I am going to have to load images with loaderMax and swfs the Adobe way.

 

 

---- Update -----

 

So in my case this only happens on gzipped servers and on Firefox.

 

Jack fixed it with a tweaked swfloader.as to compensate for FF silliness.

While I guess it'll go into a new loaderMax version, if anyone is having such a problem, that's the answer and I can send you the fix, if you can't get it from straight from Greensock.

Link to comment
Share on other sites

So in my case this only happens on gzipped servers and on Firefox.

 

Jack fixed it with a tweaked swfloader.as to compensate for FF silliness.

While I guess it'll go into a new loaderMax version, if anyone is having such a problem, that's the answer and I can send you the fix, if you can't get it from straight from Greensock.

 

Thanks for posting the update!

 

Also, the tweaked version of SWFLoader was incorporated into all the downloads as of last Friday, so nobody needs to contact bensbury for that.

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