PDA

View Full Version : movie clip x,y coordinates


i4n0
08-18-2003, 10:47 AM
hi,
when creating a movie clip using actionscript in the root timeline, the clip x,y coordinates appear to be the top left of the stage. Within the movie clip I created this way, I wrote a function to draw a set of rectangles at very specific coordinates.
I then changed the way my file was structured and am trying to draw the same rectangles with the same locations inside another movie clip instead. The problem is that the origin in the movie clip is it's centre and no longer the top left of the stage. Can this be changed or do I need to go through my function adding offsets to every coordinate reference in my various lineTo() and moveTo() statements just to get back to the poisitions I want?
This is in MX, if the procedure should be any different to previous versions.

Thanks
ian

xxlm
08-18-2003, 07:46 PM
When creating your mc you can choose the origin of your mc.
Else, if your mc is already made and the origin isn't at the good place, simply move the object that inside the mc.
Let say your origin is in the center. You want it to the upper left
Edit your MC (for our eg its a square in it), and select the square and align it to the upper left. That's all ;)

smoke10010
08-18-2003, 10:13 PM
center everything... if someone had spent the time to say those 2 words to me it would have saved me weeks of work... keep everything centered and all the co-ordinates will stay the same.. everything wil be relative to each other making it easier to edit/move around

xxlm
08-18-2003, 10:29 PM
Yeah I'm not agree.
For me the simplest way is to have for ALL mc the origin at the top left, like this when you place th emc on the satge you know where it will be exactly without using any math like where you want the left edge + this._width/2, and so on
So my advice will be:

always align top/left the MC (origin on top left is what I mean)

CU

smoke10010
08-18-2003, 10:39 PM
hehe that's the same thing except you chose a different origin.. but if you use actionscripted movement or so on you will have to use math to do the right edge.. that's if i understood u correctly.. either way it doesn't matter you need to calculated no matter what...
but it doesn't matter where you center a mc just do waht you can to make everyhting relative to each other to save yourself a headache

xxlm
08-18-2003, 11:23 PM
euh....
I didn't get what you mean... or just a few...
But I think (for my case) it's easier to use top left corner as the origin... ;)
(i'm Aries, so a bit narrow minded :p )