Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 08-18-2003, 10:47 AM   #1
i4n0
Registered User
 
Join Date: Aug 2003
Location: Edinburgh, Scotland
Posts: 3
Default movie clip x,y coordinates

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
i4n0 is offline   Reply With Quote
Old 08-18-2003, 07:46 PM   #2
xxlm
Meuh? MMeuh!
 
xxlm's Avatar
 
Join Date: Sep 2001
Location: Auckland - New Zealand
Posts: 3,050
Send a message via ICQ to xxlm Send a message via AIM to xxlm Send a message via MSN to xxlm Send a message via Yahoo to xxlm
Default

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
__________________
I'm a froggy, so excuse me for my poor english
Blog - Dev By MX
For any jobs go on my blog on the contact page...

Last edited by xxlm; 08-18-2003 at 07:55 PM.
xxlm is offline   Reply With Quote
Old 08-18-2003, 10:13 PM   #3
smoke10010
Member
 
Join Date: Jul 2003
Posts: 80
Default

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
smoke10010 is offline   Reply With Quote
Old 08-18-2003, 10:29 PM   #4
xxlm
Meuh? MMeuh!
 
xxlm's Avatar
 
Join Date: Sep 2001
Location: Auckland - New Zealand
Posts: 3,050
Send a message via ICQ to xxlm Send a message via AIM to xxlm Send a message via MSN to xxlm Send a message via Yahoo to xxlm
Default I'm not agree

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
__________________
I'm a froggy, so excuse me for my poor english
Blog - Dev By MX
For any jobs go on my blog on the contact page...
xxlm is offline   Reply With Quote
Old 08-18-2003, 10:39 PM   #5
smoke10010
Member
 
Join Date: Jul 2003
Posts: 80
Default

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
smoke10010 is offline   Reply With Quote
Old 08-18-2003, 11:23 PM   #6
xxlm
Meuh? MMeuh!
 
xxlm's Avatar
 
Join Date: Sep 2001
Location: Auckland - New Zealand
Posts: 3,050
Send a message via ICQ to xxlm Send a message via AIM to xxlm Send a message via MSN to xxlm Send a message via Yahoo to xxlm
Default

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 )
__________________
I'm a froggy, so excuse me for my poor english
Blog - Dev By MX
For any jobs go on my blog on the contact page...
xxlm is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:50 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.