Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-27-2010, 06:20 PM   #1
Seanny
Registered User
 
Join Date: Nov 2010
Posts: 12
Default parent addchild without inherit its x&y coordinate

Dear all,

Is there anyway to implement the parent addchild without its parent x and y coordinate?
lets say,
ActionScript Code:
iamparent.x =100 iamparent.y=100; iamchild.x=100; iamchild.y=100; iamparent.addChild(iamchild);

the final coordinate of the child would be x=200, y=200.
But, is there anyway that that i cant addChild with only respect to the coordinate of iamchild?
Seanny is offline   Reply With Quote
Old 12-27-2010, 06:29 PM   #2
the binary
Senior Member
 
the binary's Avatar
 
Join Date: May 2003
Location: berlin | germany
Posts: 960
Default

what do you expect.. ?
maybe you can do something with 'localToGlobal' ..
__________________
8bm
the binary is offline   Reply With Quote
Old 12-27-2010, 06:42 PM   #3
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,886
Send a message via Skype™ to henke37
Default

It is a fundamental property of the flash display system that transformations are inherited and merged. You can not change this.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 is offline   Reply With Quote
Old 12-27-2010, 06:49 PM   #4
Seanny
Registered User
 
Join Date: Nov 2010
Posts: 12
Default

i am doing a multitouch platform application~
so i have to inherit its other propeties~
but i nid to filter its x and y coordinate~
and for your solution,
i am drawing a line in a sprite.
the sprite will can rotate, scale and move~
my line drawing is based on global coordinates~
i gt ur idea, i will try in this direction~
but hopefully got clearer solution for me~
anyway, thanks for reply and ur help~!
Seanny is offline   Reply With Quote
Old 12-27-2010, 07:01 PM   #5
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,886
Send a message via Skype™ to henke37
Default

Draw the line in another container then, problem solved.

You also want this to allow for proper layering.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 is offline   Reply With Quote
Old 12-27-2010, 07:43 PM   #6
Seanny
Registered User
 
Join Date: Nov 2010
Posts: 12
Default

Everyone~
i have done it using globaltolocal~
here is an example~

ActionScript Code:
var clickPoint:Point = new Point(e.stageX,e.stageY); clickPoint=mainextend.globalToLocal(clickPoint);            trace("globalToLocalmove123="+mainextend.globalToLocal(clickPoint)); trace("move123 EVENT ID="+e.ID+" x ="+e.stageX+" y ="+e.stageY);

thanks for giving me help~
and the example is ready for the people who in need~
Seanny 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 On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:40 AM.

///
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.