To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 11-03-2009, 04:50 PM   #1
blu3
Member
 
Join Date: Jun 2006
Location: Croatia
Posts: 82
Question localToGlobal and nested movieclips question

Hi,

Let's say i have a 3 movieclips which are nested one in other like this:

A-> B-> C

And i would like to find out C movie clip (which is in B mc and B mc is in A mc) coordinates relative to global stage, how can i accomplish that?

Thanks in advance,
Best regards
blu3 is offline   Reply With Quote
Old 11-03-2009, 05:20 PM   #2
AttackRabbit
rabid_Delineator
 
AttackRabbit's Avatar
 
Join Date: Dec 2003
Location: Orlando, Florida
Posts: 307
var convertPoint:Point = new Point(c.x, c.y);
c.localToGlobal(convertPoint);
AttackRabbit is offline   Reply With Quote
Old 11-03-2009, 05:48 PM   #3
blu3
Member
 
Join Date: Jun 2006
Location: Croatia
Posts: 82
I complicated things a "bit" the thing is i have a Main class in which i add another let's say ClassA in which i add another let's say ClassB. All theese classes extend Sprite class. Now, i am in a ClassB code in which i try to position ExampleMc movie clip so in ClassB i have the following line:
Code:
addChild(ExampleMc):
And now i am trying to position ExampleMc:

Code:
ExampleMc.x =
ExampleMc.y =
but relative to global stage coordinates. What is the right way to do that?

Thanks,
Best regards
blu3 is offline   Reply With Quote
Old 11-03-2009, 06:12 PM   #4
AttackRabbit
rabid_Delineator
 
AttackRabbit's Avatar
 
Join Date: Dec 2003
Location: Orlando, Florida
Posts: 307
I mean , i don't know if there is a right or wrong way to doing that , and i'm almost certain I have no idea what you are doing. The above method is what adobe recommends doing , so I am in agreement with that. In your case since you have so many things all over , in many different scopes , i would try to localize all their values , in one place. Like write a position manager class , that does nothing more then create arrays of different objects at different scopes within your app , and keep track of their global positions.
AttackRabbit is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Actionscript 3.0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:19 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.