setRegistrationPoint ?

  • joebert
  • Sledgehammer
  • Genius
  • User avatar
  • Posts: 13496
  • Loc: Florida

Post 3+ Months Ago

FlashMX(v6)
I'm using createEmptyMovieClip then using actionscript to build the clip.
Basic Example,
Code: [ Select ]
_root.createEmptyMovieClip("cursB",5);
    with (_root.cursB){
        lineStyle (1, 0xFF0000, 100);
        cursB.lineTo(10,0);
        cursB.lineTo(10,10);
        cursB.lineTo(0,10);
        cursB.lineTo(0,0);
    }
  1. _root.createEmptyMovieClip("cursB",5);
  2.     with (_root.cursB){
  3.         lineStyle (1, 0xFF0000, 100);
  4.         cursB.lineTo(10,0);
  5.         cursB.lineTo(10,10);
  6.         cursB.lineTo(0,10);
  7.         cursB.lineTo(0,0);
  8.     }


I want to use actionscript to rotate this clip but I want the center of it to be used as the registration point instead of 0,0 that createEmptyMovieClip seems to default to.

I've looked through the index of the actionscript box for things like _RegistrationPoint with no success, Google has found me nothing about registration points other than how to set them in authoring. (clicking that little grid)

I'm going to try starting the movieClip creation at negative points to the stage to see if the registration point stays at stage 0,0 giving me a center point (with my luck it's going to cut my clip in half :roll: ) but figured i'd ask around while testing. :)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Sledgehammer
  • Genius
  • User avatar
  • Posts: 13496
  • Loc: Florida

Post 3+ Months Ago

joebert wrote:
I'm going to try starting the movieClip creation at negative points to the stage to see if the registration point stays at stage 0,0 giving me a center point . :)


This worked :D
Subtracting 50% of my movieClips total width and height from each of my drawing methods gave me a center registration point instead of a top-left one.

NOTE: My movieClip has an Odd number for the width & height, the 50% was taken from theese numbers -1 and the 1 was taken into consideration for _x & _y.

Now to figure out how to make new movieclips using negative numbers a little easier :lol:

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 11 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.