Jump to content
Search Community

Targeting a Movie Clip [SOLVED]

CantinaDan test
Moderator Tag

Recommended Posts

Hi. I'd like to be able to target a series of movieclips based on the name of the clip that was clicked. I tried this but it didn't work:

 

TweenLite.to(e.currentTarget.name + "Arrow", .3, {x:1200});

When I trace e.currentTarget.name + "Arrow" I get the appropriate name string.

 

Here is the output error:

ReferenceError: Error #1069: Property x not found on String and there is no default value.

 

On an unrelated note: I've just used TimeLineLite for the first real time. OMG - it rocks hard! So many times I'd program a complex series of tweens only to have someone want to change an early timing issue. I'd then have to laboriously recalculate all my delays. THANK YOU!

Link to comment
Share on other sites

ReferenceError: Error #1069: Property x not found on String and there is no default value.

 

The problem is that you're trying to tween a literal String, not the object. All you need to do is wrap it in this[] and you should be fine:

 

TweenLite.to(this[e.currentTarget.name + "Arrow"], .3, {x:1200});

 

I've just used TimeLineLite for the first real time. OMG - it rocks hard! So many times I'd program a complex series of tweens only to have someone want to change an early timing issue. I'd then have to laboriously recalculate all my delays. THANK YOU!

 

Ha ha - glad to hear you're enjoying it. Yeah, once you get the hang of what it can do, it can be pretty exciting. You saw the video at http://blog.greensock.com/timeline-basics/ right?

 

Have fun.

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