Jump to content
Search Community

Object oriented TweenLite.from()?

GRAPHiCbr test
Moderator Tag

Recommended Posts

Hi all,

 

Is there a way that I can use the object oriented syntax to make a from() call with TweenLite?

So I can later use a myTween.reverse().

 

Ex:

 

myTween:TweenLite = new TweenLite.from(mc, 1, {something});

later on... myTween.reverse();

 

I tryed it all btu I allways get the msg "1048: Method cannot be used as a constructor."

Where CAN I use the Method then?

 

Thx.

Link to comment
Share on other sites

As usual, TronicVolta is exactly right. But just so you know, you can do the from() call instead, like:

 

var myTween:TweenLite = TweenLite.from(mc, 1, {x:1000});

 

Your problem was that you were adding "new" before the static method call.

 

BAD: var myTween:TweenLite = new TweenLite.from(mc, 1, {x:1000});

GOOD: var myTween:TweenLite = TweenLite.from(mc, 1, {x:1000});

ALSO GOOD: var myTween:TweenLite = new TweenLite(mc, 1, {x:1000, runBackwards:true});

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