A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Controlling Width

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    5

    Controlling Width

    Hello all, I have an actionscript 3 scene that has a bunch of movie clips which will behave as buttons and a bar graph at the botom which is supposed to increase in width depending on which movie clip I click on. I can get it to increase or decrease when I click on the movie clips, but my problem is that I want the bar to grow from the size it currently is at, and not to always start from the size that I made it on the stage. Thanks for any help in advance.

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    How are you managing the tween?

  3. #3
    Junior Member
    Join Date
    Jul 2008
    Posts
    5
    I am importing the fl.transitions.tween and fl.transitions.easing classes that come with flash, and my code is:

    bNewYork.addEventListener(MouseEvent.CLICK, clickNY);

    function clickNY(evt:Event):void {
    trace(evt.target.name);
    var tweenBar:Tween = new Tween(mBoxTest, "width", Strong.easeOut,0,100,2,true);
    }

    Thanks

  4. #4
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Change the 'start' parameter to the current width:

    PHP Code:
    var tweenBar:Tween = new Tween(mBoxTest"width"Strong.easeOut,mBoxTest.width ,100,2,true); 

  5. #5
    Junior Member
    Join Date
    Jul 2008
    Posts
    5
    Thanks alot, that has been driving me crazy all morning. I really appreciate your assistance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center