Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Slayer01

transformAroundPoint

Recommended Posts

// Hi

// I just bought the ”Really Green” membership and I have some problem using the “transformAroundPoint” plugin.

 

///***********************///

 

// I have imported the classes

 

import com.greensock.*;

import com.greensock.easing.*;

import com.greensock.plugins.*;

 

// When I try to change registration point of my Sprite container ”_container”

 

TweenMax.to(_container, 1, {transformAroundPoint:{point:new Point(100,50)}, ease:Elastic.easeOut});

 

// I get the error that the “transformAroundPoint” plugin cannot be found.

// What am I doing wrong.

Link to comment
Share on other sites

Did you download the bonus zip file from your GreenSock account? https://www.greensock.com/account/

 

Make sure you've got the TransformAroundPointPlugin.as file which should be in the com/greensock/plugins/ folder. I bet you just forgot to use the stuff that came in the bonus zip. (that zip file contains all the GreenSock classes too, not just the bonus plugins/classes).

 

Also, this tween wouldn't do anything because you didn't tell it to tween any properties:

TweenMax.to(_container, 1, {transformAroundPoint:{point:new Point(100,50)}, ease:Elastic.easeOut});

 

Maybe you meant to tween the scaleX and/or scaleY or something?

TweenMax.to(_container, 1, {transformAroundPoint:{point:new Point(100,50), scaleX:0.5, scaleY:0.5}, ease:Elastic.easeOut});

Remember, transformAroundPoint doesn't actually change the registration point of your object - it just allows you to tween it in a way that ACTS like the registration point is in a different spot (for that particular tween).

Link to comment
Share on other sites

Did you download the bonus zip file from your GreenSock account? https://www.greensock.com/account/

 

Make sure you've got the TransformAroundPointPlugin.as file which should be in the com/greensock/plugins/ folder. I bet you just forgot to use the stuff that came in the bonus zip. (that zip file contains all the GreenSock classes too, not just the bonus plugins/classes).

 

If you mean if I forgot to use the "com folder" inside the "as3 folder" that was in the bonus zip.file. Then no I didn't.

 

I understand now that I made a mistake when I didn't specify the scaleX and scaleY properties.

 

I still get the error that "TransformAroundPointPlugin" cannot be found.

 

Do I have to modify the "TransformAroundPointPlugin.as" file somehow.

 

Could you show me an example of all the code that I might need to use in my dokument class to make this work?

Mabey I missed something...!

 

Thanks

Link to comment
Share on other sites

No, you certainly don't need to modify the plugin file.

 

The only other code necessary to make the tween work (which I assume you already did based on the error you mentioned) is to activate the plugin first:

 

import com.greensock.plugins.*;
TweenPlugin.activate([TransformAroundPointPlugin]);

 

That's it. Are you 100% positive that you have the bonus plugin there? Maybe you put it in a different folder or something? Feel free to zip up your whole directory and send me a link to it (private message or e-mail, not here in the public forums).

Link to comment
Share on other sites

No, you certainly don't need to modify the plugin file.

 

The only other code necessary to make the tween work (which I assume you already did based on the error you mentioned) is to activate the plugin first:

 

import com.greensock.plugins.*;
TweenPlugin.activate([TransformAroundPointPlugin]);

 

That's it. Are you 100% positive that you have the bonus plugin there? Maybe you put it in a different folder or something? Feel free to zip up your whole directory and send me a link to it (private message or e-mail, not here in the public forums).

 

Thank you very much for your help

 

I forgot to add the line -- TweenPlugin.activate([TransformAroundPointPlugin]); -- earlier, that is why it didn't work.

 

But now everything works fine. :D

 

Thanks

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