A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: _rotation ignores registration point?

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    237

    _rotation ignores registration point?

    Hi.

    Does _rotation ignore the MC's registration point? If so, how do I get around this? I have a MC that I set the registration point to the top right hand corner. And on the MC I have this code:

    PHP Code:
    onClipEvent(enterFrame) {
      
    this._rotation += 5;

    and it rotates, you guessed it, around the top left hand corner!!! Is there any way to make it NOT ignore where the registration point is set?

    Thanks,

    ~j.

  2. #2
    Qwaizang:syntax_entity_ Q__Hybrid's Avatar
    Join Date
    Aug 2005
    Posts
    270
    JLo,

    How are you placing the instance on the stage?

    If you are placing the instance manually at author-time and simply dragging the circular registration point used by the Free Transform tool, this won't work.

    If you want your instance to rotate from the upper right corner, you must do the following:

    1. Go into your library and double-click the instance to get into the edit mode.
    2. Use the Selection Tool to drag and select everything in the frame.
    3. Use the Properties Toolbar and enter the Width of the selection times negative one into the X property input box. Example:
    Code:
    // initial properties in toolbar
    W: 30  X: 0
    H: 30  Y: 0
    
    // fixed properties in toolbar
    W: 30  X: -30
    H: 30  Y: 0
    I haven't found a quicker, cleaner, or easier way to approach this. If you have multiple frames, you'll have to apply this manual translation to each frame.

    +Q__
    Qwai•zang \kwî-'zan\ n [origin unknown] 1 : abstract designer, esp. of complex real-time experiments, c. 21st century

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Posts
    237
    Thanks Q__Hybrid. I figured this out, but it seems very unintuitive and awkward. I wonder why Flash did it this way. The drawback to this is that every instance where this image appears will now be shifted on the screen by however many pixels to the left.

    Another drawback is: what if I wanted to rotate one instance based on the top left corner and another based on the top right corner? In that case I would have to create two identical movieclips (w/ the X position shifted)! Just so I can rotate it different ways! Preposterous!

    Okay, maybe I'm overreacting a little bit. But still!

    Thanks again for your help,

    ~jimmy.

  4. #4
    Qwaizang:syntax_entity_ Q__Hybrid's Avatar
    Join Date
    Aug 2005
    Posts
    270
    JLo,

    One possibility is to nest the mc you want to rotate inside of a container mc, then rotate the container mc. You would simply place the nested mc at the same coordinates I described, but using script instead. This may pose problems, but it's worth a shot.

    +Q__
    Qwai•zang \kwî-'zan\ n [origin unknown] 1 : abstract designer, esp. of complex real-time experiments, c. 21st century

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