You should ' play ' with swapChildren or swapChildrenAt
While I am loading a swf into a container (main.swf), I have a nice graphic page tween that I would like to cover the screen while the external swf is being loaded. I can run this tween that is in main.swf when the call is made to unload the current swf and load the new swf. BUT, the new swf loads on top of the animation. Can I set the layer of the animation so that it is on top, so that the animation hides the transition from the current swf to the new swf? ( it is an oil painter site, and he likes an animation I did that 'paints' the screen to hide the current page, and when the painted screen goes away, the new page is underneath.)
You should ' play ' with swapChildren or swapChildrenAt
hmmm, I'm having trouble with this . . . am I close to the answer? The 'id' is an int, and I'm having trouble swapping display object pageTween with an int.
pageTween.play();
id=m.target.parent.id+1;
loader.unload();
removeChild(loader);
rimuoviListeners(loader.contentLoaderInfo);
loadPage(m.target.parent.id+1);
setChildIndex(pageTween, 0);
//setChildIndex ((m.target.parent.id+1), 1)
trace("tween level is " + getChildIndex(pageTween));
//trace("tween level is " + getChildIndex((m.target.parent.id+1)));
swapChildrenAt(1,0);
Did you try with swapChildren() ?
If I do this:
swapChildren(pageTween, m.target.parent):
- I get the error of "The Supplied DisplayObject must be a child of the caller" - does that mean that the page tween should be inside each child swf instead of one copy in the main.swf?
Same error if I do:
setChildIndex(m.target.parent, 0)
setChildIndex (pageTween, 1)
swapChildrenAt(0, 1);
cos they must be in the same father.
You should swap the loader with the tween, i think...![]()
Nope. Even moved the tween and the swap to the loadPage function, and got either the coertion (wanted object, got int), or the 'child of caller' error when swapping with any of the statement objects.
Could it be that I should load the target swf and the tween into an empty mc in main.swf, so that they are children of the same object, then swap them?
before to swap the loader, did you say:
var m:MovieClip=loader.content as MovieClip;
swapChildren(m,tween);
I get ' a conflict with definition m in namespace internal
change its name
var nn:Mov....
Bookmarks