Jump to content
Search Community

reset transformAroundPoint

createcomm test
Moderator Tag

Recommended Posts

How can I remove or reset transformAroundPoint effect. I have a mc that get's animated using transformAroundPoint. That all works fine. But I need to be able to replay the flash ad. Somehow it looks like the centerpoint from where transformAroundPoint is animating is changed


function heliMove2 () {
apache.scaleX *= -1;
var timelineHeli2:TimelineLite = new TimelineLite();
timelineHeli2.append(TweenLite.to(apache, 2, {x:-20, y:50, ease:Expo.easeInOut, transformAroundPoint:{point:new Point(200, 200), rotation:170}} ) );
timelineHeli2.append(TweenLite.to(apache, 4, {x:500, y:160, ease:Expo.easeInOut, transformAroundPoint:{point:new Point(200, 200), rotation:185}} ) );
I'm pretty sure it has to do whit the scaleX (flip horizontal), but can't seem to solve it
Link to comment
Share on other sites

Its tough to say without knowing how and when that function is called, but yeah, flipping the scaleX might be the culprit. Have you tried setting the scaleX and transformAroundPoint values back to their natural pre-tween states when you try to replay your banner?


Feel free to strip everything out of your file not related to this issue and post the fla (don't include the GreenSock classes). We'll be glad to take a look.

Link to comment
Share on other sites



function heliMove() {
// *** NEW ***
apache.rotation= 180;
// *** END NEW ***

var timeline:TimelineLite = new TimelineLite();

timeline.append(TweenLite.to(apache, 1, {x:232, y:217, ease:Expo.easeOut, transformAroundPoint:{point:new Point(200, 200)}} ) );
timeline.append(TweenLite.to(apache, 3, {x:-200, y:200, ease:Expo.easeIn, transformAroundPoint:{point:new Point(200, 200), rotation:160}} ) );

Also, it appears to me you could do ALL your sequencing with TimelineLite, you really don't need to be building sequences of function calls like:

function OpbouwBanner():void {
var sequence:Array = new Array();


sequence.push(200, [tekst1, "gotoAndPlay", 2]);
sequence.push(100, [logo, "gotoAndPlay", 2]);
sequence.push(250, [this, "heliMove"]);
sequence.push(2500, [this, "tekst1Move"]);
sequence.push(750, [this, "tekst2Move"]);
sequence.push(1250, [this, "heliMove2"]);
sequence.push(4000, [this, "tekst3Move"]);
sequence.push(1000, [this, "heliMove3"]);
sequence.push(2500, [this, "tekst4Move"]);

sequence.push(2500, [this, "Replay"], [apache, "gotoAndStop", 1], [this, "stopTimer"]);

TimelineLite/Max have a call() methods that allow you to call functions at any time from your timeline. 
Also you can add multiple timelines to a main timeline which makes creating and repeating complex sequences a breeze.
Perhaps keep it in mind for your next project.
Link to comment
Share on other sites

Thnx! That works. I'm gonna look into the 'call' method.


The way with the sequences comes from a long history of making these banners. Would we have the time to set them all up again from start we would definitely would change that

  • Like 1
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...