A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: moving MClip smoothly using Actionscript

  1. #1
    Member
    Join Date
    Aug 2004
    Posts
    52

    moving MClip smoothly using Actionscript

    I have a menu with a box that surrounds the menu text for the selected link. I have it so that each time a link is pressed the box (a sperate MC) is moved to surround the appropriate menu text (i.e. which one was pressed. This was done by using

    this.contactPage.onRelease = function{
    menuBox._y = 320;
    }

    and etc. for each menu btn. The problem is that when it moves to the place it does it instantaeously where as I would like it to slide smoothly from its present position to the preset position (e.g. _y = 320). Is there a way to do this with actionscript? Thanks in advance masters of Flash!

    J
    Last edited by dptoot; 10-13-2004 at 01:03 PM.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    ON the box MC.........

    onClipEvent(enterFrame){
    this._y+=(_root.ypos-this._y)/7;
    }

    ...and code for the button

    _root.ypos=320;

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

  3. #3
    Member
    Join Date
    Aug 2004
    Posts
    52
    super advice works perfectly

    thanks... yay Flash Kit

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