View Full Version : Changing the Focal point of an MC
norie
August 1st, 2003, 12:25 PM
say you draw a simple MC (a square for the mathematically challeneged):
with (path.createEmptyMovieClip("mask", 2)) {
beginFill(0x0000FF, 100);
moveTo(0, 0);
lineTo(100, 0);
lineTo(100, 100);
lineTo(0, 100);
lineTo(0, 0);
endFill();
}
the current focal point is in the top left corner, how could i change the focal point? Is this possible?
kode
August 1st, 2003, 12:36 PM
with (path.createEmptyMovieClip("mask", 2)) {
beginFill(0x0000FF, 100);
moveTo(-50, -50);
lineTo(50, -50);
lineTo(50, 50);
lineTo(-50, 50);
lineTo(-50, -50);
endFill();
}
??
norie
August 1st, 2003, 12:39 PM
well i know i can draw it differently, but is there any other way?
kode
August 1st, 2003, 12:40 PM
Nope...
You can't change its registration point using ActionScript.
norie
August 1st, 2003, 12:40 PM
oh.....thanks kax
kode
August 1st, 2003, 12:41 PM
No problem. ;)
senocular
August 1st, 2003, 12:44 PM
Flash has nothing which would let you change the focal or center or registration point directly. All visual content within a movieclip is based absolutely around that point.
So your options are, as you know 1) to redraw the shape or 2) instead of drawing the lines directly within that movieclip, create another movieclip within that clip and draw in that new clip. Then, to change the registration point, you just move that inner clip - then the whole drawn shape would move in respect to the reg point and appear as if it was moving - though the main clip itself is still positioned by that point so if you want the point to move you would have to move the clip counter to that etc... but you get the idea
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.