Jump to content
Search Community

Can't tween MC from SWC which extends custom class

flabbygums test
Moderator Tag

Recommended Posts

Hi,

 

I can tween movieClips that were nested in my swc just fine - as long as they are declared as MC. For eg. my swc name is Page01.SWC and in that swc is a movieclip called Hero. I use:

 


//WORKS
private var p01:Page01 = new Page01()
addChild(p01)
private var Hero:movieClip = p01._hero
TweenLite.to(Hero,1.5, {y:640})

 

This works fine! However, if I then make Hero extend a custom class called 'Character' , which simply extends movieClip, the tween fails. But, I can trace out the tweens values just fine -- I just cannot see anything actually tween? Eg.

 

 


//FAILS BUT I CAN TRACE VALUES
private var p01:Page01 = new Page01()
addChild(p01)
private var Hero:Character = new Character (p01._hero)   //where Character extends MovieClip
TweenLite.to(Hero,1.5, {y:640})        

 

Any idea why this is happening? My gut tells me this would be a targeting issue, however, since I can see values moving but not the tween... maybe it's because the MCs are nested in the SWC and tweenLite cannot update the stage?? Thanks for any help.

Link to comment
Share on other sites

TweenLite doesn't really care about the stage or anything like that - it just updates the values that you ask it to during the tween. When you say that you can trace the values changing, what exactly do you mean? With an onUpdate? Are you 100% sure that you are indeed targeting things correctly with your code? You didn't include a lot of the code that might be pertinent, so it is tough to know exactly what's going on inside your Character class or where/how you're adding things to the display list, etc. I strongly suspect the problem has to do with something in your class/setup but it's tough to know for sure. If you still need help, please post a very simple FLA (and support files) that clearly demonstrate the issue. No need to post your production files - just something with the minimal code necessary.

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