A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Float Object within Movie Clip AS3

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    26

    Float Object within Movie Clip AS3

    Hi

    I am using AS3 and want to have an object floating in a movie clip.

    I can make a movie clip float in the middle of the stage but not in a movie clip.

    How do I do this?

    Thanks

  2. #2
    Junior Member
    Join Date
    Oct 2007
    Posts
    26
    In fact how do you find the width of a movieclip using AS3
    similar to stage.stageWidth?

  3. #3
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    A MovieClip's width is accessible through it's width property.
    Code:
    trace(aClip.width);

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    import flash.geom.Point;
    var point:Point = new Point(a.width/2 - a.m.width/2, a.height/2 - a.m.height/2);
    a.m.x = point.x;
    a.m.y = point.y;

    a is the parent movieclip.
    - The right of the People to create Flash movies shall not be infringed. -

Tags for this Thread

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