Jump to content
GreenSock

BloodyLyons

tweenlite wont tween my movieclip but will on all the others

Recommended Posts

Hi

 

for some reason TweenLite will not tween a movieclip i tell it to,

 

The linkage and everything else is fine, the movieclip is called dynamically and i can see it on the stage when i run my swf.

However if i try and get TweenLite to tween it it wont, even though Tweenlite works fine on.

 

Does it matter if the movieclips are nested in folders in my library? if so how do i target a MC in a folder?

 

heres the code that works (also on many other buttons)

 

var attractionsBg = new Attractions_BG();
attractionsBg.alpha=0;
addChild(attractionsBg);

TweenLite.to(attractionsBg ,1,{alpha:1, ease:Strong.easeOut, delay:1.5, overwrite:true});

 

and the code that doesnt work

 

var towerBg = new Tower_BG();
towerBg.alpha=0;
addChild(towerBg);

TweenLite.to(towerBg ,1,{alpha:1, ease:Strong.easeOut, delay:1.5, overwrite:true});

 

Heres my library folder set up

 

Attractions > Attractions Menu > MC's > Attractions_BG();

 

Attractions > Tower > MC's > Tower_BG();

 

all my code is in 1 actionscript file which is external and linked with the classpath,

all the other mcs at a higher level seem to work except this one!?!

 

 

pulling my hair out!

Link to comment
Share on other sites

No, it doesn't matter what library folder your asset is in. I think there must be something else going on in your code that's causing the problem. If you haven't figured it out yet, please post an example FLA that demonstrates the problem clearly (the simpler the better). Don't forget to zip your file(s) first.

Link to comment
Share on other sites

cheers,

ill get a stripped down version of the FLA together now and upload, its for a uni assignment due in tomorrow night!!!

thing is ive used tweenlite before and never experienced this, its like it is basically ignoring a chunk of code when a function is called a second time around.

 

mark

Link to comment
Share on other sites

heres the FLA

 

You can download from http://www.quarterlightdesign.com/Blackpool.zip

 

(says to big for forum, ive pruned all the sound and images out and left

the movie clips in with some crude shapes to demonstrate how the tweens are not working)

 

 

 

basically, im using tweenlite to fade and transition MCs onto the stage and then swap with other MC's on click events

 

When i go

Homepage > Attractions then back to Homepage its fine.

 

When i go

 

Attractions > Tower and back to Attractions its fine

 

BUT when i go

 

Homepage > Attractions >Tower then back to attractions (fine), back to Homepage(not fine,)

the attractions MC's dont tween and are left visible between other transitions almost like they are stuck there unable to be called.

 

 

Hope you can help!!!

mark

 

ps tweenlite is awesome!

Link to comment
Share on other sites

I haven't had time to look at this in depth, but I did notice right away that you're using a bunch of nested functions (and even nested nested functions)! I'd strongly recommend steering clear of that - they can cause all sorts of problems because nested functions get deleted as soon as the parent function finishes executing. It looks like you're trying to refer to local variables from the parent function inside your nested functions, but since they're event handlers and not getting called until after the parent function finishes running, those local variables have likely been deleted by the time the nested listener function is called. See what I mean? Could you un-nest the functions and then let us know if you still need help?

Link to comment
Share on other sites

Thanks so much for taking the time to have a look dude!!

 

i was thinking it was something along those lines, i had everything pretty much un nested when i started out on the project, ill work on it now and let you know

 

cheers again

Link to comment
Share on other sites

ive un nested everything but then when function backToAttractions is called it throws up errors not knowing what the variables are

 

1120: Access of undefined property backFromAttractions_btn.

Link to comment
Share on other sites

ive un nested everything but then when function backToAttractions is called it throws up errors not knowing what the variables are

 

1120: Access of undefined property backFromAttractions_btn.

 

If you want help with that, you need to post your code/FLA. If it's not something related to GreenSock code, though, the actionscript.org or kirupa.com forums would probably be better because they're more general (this one is just for GreenSock-related stuff).

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