Jump to content
Search Community

tween onLoadInit AS2

Tomeo test
Moderator Tag

Recommended Posts

Alpha doesn't go from 0-100, it emidietly jumps to 100! Can someone tell me what is wrong? Thank you!

 

var pictureLoader:MovieClipLoader = new MovieClipLoader();

var pictureLoaderListener:Object = new Object();

pictureLoader.addListener(pictureLoaderListener);

 

pictureLoader.loadClip("mySwf.swf", mcPictureLoader);

 

pictureLoaderListener.onLoadInit = function(targetPicture:MovieClip):Void {

targetPicture._alpha = 0;

TweenLite.to(targetPicture,.2,{_alpha:100, ease:Quad.easeIn});

};

Link to comment
Share on other sites

It's been a while since I worked with AS2 in depth, but have you tried using a trace() to make sure your targetPicture is what you think it is? I also remember there being issues with the onLoadInit getting called before the object was fully instantiated, so the _alpha property might be getting reset a millisecond after you set it to 0. In that case, try adding a slight delay before doing your tween. Or use TweenMax.fromTo() which allows you to set your starting and ending values.

Link to comment
Share on other sites

Thank you,... FromTo and Delay is not working either.

 

I tried this with custom fadeIn - onEnterFrame function and its working OK (alpha 0-100). TweenMax only works for me, when content is already in the browsers cache, or when I preview my swf without "simulate download". Otherwise, it looks like object properties are set to end values, when content is freshly loaded.

 

My guess, I should start working in AS3 :-)

Link to comment
Share on other sites

I'd need to see an FLA that demonstrates the issue. I'm not aware of any problems in TweenLite/Max that could possibly cause this, but maybe you stumbled across something that nobody else did. I'd love to see an example in a super-simple FLA if you could post one. Again, please don't post your whole project - just isolate the issue in a separate, SUPER simple FLA. Don't forget to zip it before posting too. Thanks!

Link to comment
Share on other sites

Everything is working OK now.

 

I just joined the GreenSock Club. It is the least I can do...

 

Hey, that's great! Thanks so much for the support. You didn't have to join, but I sure hope the membership serves you well and the bonus plugins make your life easier (and a little more fun). Cheers!

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