A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: help please...

  1. #1
    Member
    Join Date
    Apr 2003
    Location
    PA, USA
    Posts
    63

    help please...

    i want to have a code that runs continously...

    i have two movie clips on the stage. clip1 and clip2
    i want to have a code that reposition clip2 base on the height of clip1

    for ex... i have a shape tween animation in clip1 that expands the height of a rect.

    as the rect is expanding, i want clip2 to be repositioned base on the height, so clip2 is always below the bottom of clip1.

    can someone please help?

  2. #2
    Senior Member jbum's Avatar
    Join Date
    Feb 2004
    Location
    Los Angeles
    Posts
    2,920
    This is a script that is intended to be attached to a frame. It assumes clip1 is named 'clip1' and clip2 is named 'clip2'.

    code:

    clip2.onEnterFrame = function()
    {
    this._y = clip1._x + clip1._height;
    }



    If, instead, you want to attach the script to directly to clip2, you would use this:

    code:

    onClipEvent(enterFrame)
    {
    _y = _parent.clip1._x + _parent.clip1._height;
    }


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