Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6706013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:28:13+00:00 2026-05-26T07:28:13+00:00

I have an Object and i want to apply two motion tween .I try

  • 0

I have an Object and i want to apply two motion tween .I try to append them to a Timeline but i encounter some issues.When i test it,the most of the times i have to click many times in order to have results.Also a strange thing happening,if i set the elapse time for the second tween more than 1 second ( actually more than 0.5 ) it works.I work in flash cs4 and the class is linked to a Object.

package {

import com.greensock.*;
import com.greensock.easing.*;
import flash.display.MovieClip;
import flash.events.MouseEvent;

public class Border extends MovieClip
{
     private var myTimeline : TimelineMax = new TimelineMax( );

    public function Border( ) {             
    }   

    public function doAnimate ( ev : MouseEvent )
    {
        myTimeline.append(TweenMax.to(this, 0.5, { width : 400 } ) );
        myTimeline.append(TweenMax.to(this, 0.5 , { height : 400 } ) ); // <--
    }
    public function deAnimate ( ev : MouseEvent )   
    {       
        myTimeline.reverse( );
    }
  }
}

The Main class

package {

import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;

public class Document extends MovieClip {

    public function Document( )     {
        right.addEventListener( MouseEvent.CLICK , border.doAnimate );
        left.addEventListener( MouseEvent.CLICK , border.deAnimate );
    }
  }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:28:14+00:00Added an answer on May 26, 2026 at 7:28 am

    You created your TimelineMax instance immediately (above your constructor), and it starts playing right away but you don’t populate it until later (apparently on MouseEvent.CLICK). So you’re positioning your tweens in the timeline before the virtual playhead. For example, imagine that the playhead of the timeline is at 5-seconds when you put your tweens into it at the 0-second spot. It is explained more fully at http://forums.greensock.com/viewtopic.php?f=1&t=3842&p=15044#p15044. The solution is pretty simple: just restart() your TimelineMax in your doAnimate() method. That’ll obviously make the virtual playhead move to the beginning. There are some other ways you could handle this too, but I think the simplest thing in your situation is to restart() the timeline. Feel free to ask questions in the dedicated forums at http://forums.greensock.com (we work hard to get stuff answered there promptly).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I having issues exporting a GridView to Excel for some reason. I have two
I have an object and I want to detect what type is, so I
I have a DateTime object I want to compare against an sql datetime field
I have just had a brain block, I have a Deck object and want
Hopefully an easy question. If I have an object and I want to call
I am newbie in ASP.NET MVC3. I have an Object and I want to
I have an object for which I want to generate a unique hash (override
I have a traceback object that I want to show in the nice format
I have an object of type Hash that I want to loop over via
I have an object with event handlers and I want to make something similar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.