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.