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

  • Home
  • SEARCH
  • 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 6219757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:50:25+00:00 2026-05-24T07:50:25+00:00

I have this tween transition. Everytime button X is clicked it moves the movieclip

  • 0

I have this tween transition. Everytime button X is clicked it moves the movieclip (rectangle) a bit further (varx + numberx).

var myTween:Tween = new Tween(rectangle, "x", Strong.easeOut, currentposx, varx, 3, true);

Somehow if I spam button X my computer become slow after a while. But somehow I can’t find the source of the problem. My guess is that everytime I override the tween transition the previously one is still intact somehow.

So do I have to abort a tween if it’s overwritten with another one?

  • 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-24T07:50:25+00:00Added an answer on May 24, 2026 at 7:50 am

    Using your button never should slow down the application. So there is something wrong.

    • A) Its your code
    • B) Its their code (Tween)

    So what could happen:

    - Time 0 sec - Button click - 1. tween starts, duration 3 sec.
    - Time .1 sec - Button click - 2. tween starts, duration 3 sec.
    - Time .2 sec - Button click - 3. tween starts, duration 3 sec.
    

    We start new tweens in an interval of .1 sec. After 3 sek. we have then 30 tweens running at the same time.

    At that time the first tween should end, unregister itself from any events dispatched by display objects (enter frame) or timers. Apparently it does not and your application adds tween by tween, neither is finishing.

    It could be that your tween checks the distance between currentposx and varx and only if both are equal, the tween stops. Since there are now concurrent tweens, this situation may never happen, and your tween continues trying to move your display object again and again.

    If you would show complete running code, I could test this in a profiler.

    —

    Anyway, you should store the current tween in a persistent variable such as _currentTween and either kill the tween before starting a new one or simply update the current tween’s values when clicking the button again:

    private var _currentTween : Tween;
    
    private function buttonClickedVersionA() : void {
        if (_currentTween) _currentTween.stop(); // or whatever it is called
        _currentTween = new Tween(...);
    }
    
    private function buttonClickedVersionB() : void {
        if (!_currentTween) {
            _currentTween = new Tween(...);
        } else {
            _currentTween.start = currentposx;
            _currentTween.end = varx;
            _currentTween.restart(); // or whatever
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tween like this : new Tween(myObject, x,null,nowPosition,finalPosition,time,true); sometween.start(); Now when the
I have added: sub1_btn Within sub1_btn there is a movieclip called arrow. Using this
I have this: this.slides[this.slideIndex].set('tween', {duration: '3000'}); this.slides[this.slideIndex].tween('opacity', '1'); how can i for example show
I have a movieClip with a button that I created inside of my display
I have this array of MovieClips (btnArr) and array of GlowFilters (gloArr): var btnArr:Array
I have this movieclip loaded on runtime called cHolder. I apply a tint at
I have a simple translate tween that moves an object up 200 pixels. As
I have a movieclip moving on a path by means of a tween. At
I have the following tweets table: tweet_id user_id text --------------------------------------------------- 1 2 this is
I have a text like this: 'Rails on IIS7 http://is.gd/vWPn ' (it's a tweet

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.