A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: how to....

  1. #1
    y helo thar
    Join Date
    Aug 2002
    Posts
    369

    how to....

    How to create movement with actionscript...? I have seen websites etc that resize themselves or what not but once you get the numbers you want to resize between say on the xscale you want to go from 50 to 100 how do u get it to tween to that via actionscript at a certain speed? I have been confused about this for a long while...thanks for any help - Jeff

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Put this on a movieclip.


    onClipEvent (load) {
    _root.w = 250;
    _root.h = 250;
    }
    onClipEvent (enterFrame) {
    // Set dimensions an speed and more
    speed = 5;
    // Move the thing
    this._width += (_root.w-this._width)/speed;
    this._height += (_root.h-this._height)/speed;
    }


    On buttons you can then specify new widths and heights.

    on(release){
    w=375;
    h=150;
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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