[Tweener] got it
Nolan Butcher
nolan at flexgraphix.com
Fri May 29 11:35:39 PDT 2009
Mike,
Glad you got it working! Another alternative is to target the 'loader'
property of the LoaderInfo object within your complete handler. This will
prevent the nastiness of having to target a parent object through dot
reference (which I tend to stay away from doing whenever possible - more
chance for problems down the road).
Ex:
function imgLoadComplete(event:Event) :void {
var targetLoader : Loader = LoaderInfo(event.target).loader;
Tweener.addTween(targetLoader, {alpha: 1, time: 1,
onComplete: function() {event.target.content.gotoAndPlay(2);}});
}
HTH ;)
-Nolan
From: Mike Lohrman [mailto:mikelohrman at yahoo.com]
Sent: Friday, May 29, 2009 7:55 AM
To: Tweener at lists.caurinauebi.com
Subject: [Tweener] got it
Sometimes all it takes is to ask for help to figure it out on your own.
event.target was LoaderInfo, not Loader, so alpha wasn't a property and it
wasn't working. I ended up using event.target.content.parent to reference
the loader. event.target.content was working for changing the frame, and I
was confused why that was working. After some tracing, I realized
event.target.content was referencing the loaded swf main timeline. At that
point I traced the parent of that and found the loader.
*************************
This is basically how I have this set up...
loader_0.contentLoaderInfo.addEventListener(Event.COMPLETE,
imgLoadComplete);
function imgLoadComplete(event:Event) :void {
Tweener.addTween(event.target.content, {alpha: 1, time: 1,
onComplete: function() {event.target.content.gotoAndPlay(2);}});
}
What happens is when the loader is done loading, it should fade the movie
in, then onComplete play frame 2. It won't fade in, but it does play frame 2
correctly. If I replace the first "event.target.content" with "loader_0", it
works fine. Is there any way to reference the loader from the event? Thanks!
Mike
*************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20090529/01bf90ca/attachment-0001.htm>
More information about the Tweener
mailing list