I got my "thing" to work now with localToGLobal/globalToLocal.

As long as the clip is at 100% in _yscale and _xscale, then it all works.
But when those values are modified, the localToGlobal will not be accurate any 
longer. Is there an easy fix for this?

/ martin


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Flashbordon
Sent: den 24 november 2005 17:02
To: FlashCoders @ figleaf. com
Subject: VS: [Flashcoders] localtoglobal/globaltolocal and getBounds

Hi,

It really is annoying methods....

_root.createEmptyMovieClip("somecontainer",0)
somecontainer.createEmptyMovieClip("mc1",0);
somecontainer.mc1.createEmptyMovieClip("mc2",0);

_root.somecontainer._x = 100;
_root.somecontainer._y = 50;

_root.somecontainer.mc1._x = 10;
_root.somecontainer.mc1._y = 20;

_root.somecontainer.mc1.mc2._x = 50;
_root.somecontainer.mc1.mc2._y = 40;

//localToGlobal:
//I want the coordinates of mc2 in the global space:

var p:Object = {x: _root.somecontainer.mc1.mc2._x, y:
_root.somecontainer.mc1.mc2._y};
_root.somecontainer.mc1.localToGlobal(p);

trace(p.x); // 160 (100 + 10 + 50)
trace(p.y); // 110 (50 + 20 + 40)

//globalToLocal:
//i want the global coordinates 300,300 in local mc2-coordinates.

var p:Object = {x: 300, y: 300};
_root.somecontainer.mc1.mc2.globalToLocal(p);

trace(p.x); // 140 (300 - 100 - 10 - 50)
trace(p.y); // 190 (300 - 50 - 20 - 40)

I don't know about getBounds

-martin



-----Oprindelig meddelelse-----
Fra: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] På vegne af Martin
Klasson
Sendt: 24. november 2005 15:17
Til: Flashcoders mailing list
Emne: [Flashcoders] localtoglobal/globaltolocal and getBounds


Hi Coders.

As you see in the subject.. that is what I want to learn more about. 
I have been in the help and read about it, but it is still very
confusing how they work.

Are there any great pages that you have spotted somewhere, online, in
which really can describe them and how they can be used and so on?

I have googled, but these are not so oftenly used, though they really
should be handy sometimes. Thanks.

/ martin
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/180 - Release Date: 23-11-2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/180 - Release Date: 23-11-2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/180 - Release Date: 23-11-2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.7/180 - Release Date: 23-11-2005
 

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to