January 6th, 2009 AS Tween problem

  • allBars is a MC on the stage.

    I am thinking this should take allBars MC and tween it from its corrent _x position to _x position -55?

    but nothing happens?



    //Import the classes
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var nStartXPos:Number = allBars._x;
    trace(nStartXPos);
    center_Btn.onRelease = function():Void {
    trace(nStartXPos);
    var twSlideLeft:Tween = new Tween(allBars, "_x", Regular, nStartXPos, -55, 3, true);
    };


  • Try what SlowRoasted said, and also there could a referencing issue. nStartXPos is being declared locally.
    No it's not, and even if it was all code written in any scope always references that scope unless you reference a different one.


  • crazy, it needed the easeOut, I was under the impression that was optional...


  • Try what SlowRoasted said, and also there could a referencing issue. nStartXPos is being declared locally. //Import the classes
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var nStartXPos:Number = allBars._x;
    trace(nStartXPos);
    center_Btn.onRelease = function():Void {
    //assuming Center_Btn is on the root level
    trace(_parent.nStartXPos);
    var twSlideLeft:Tween = new Tween(_parent.allBars, "_x", Regular, _parent.nStartXPos, -55, 3, true);
    };


  • hmmm, try adding easeOut after Regular.


    var twSlideLeft:Tween = new Tween(allBars, "_x", Regular.easeOut, nStartXPos, -55, 3, true);


    Im not sure if it needs that or not.


  • I had no clue, just took a wild guess:P That's good to know though.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about AS Tween problem , Please add it free.