Play around with this: var mSprite:Sprite = new Sprite();
mSprite.graphics.beginFill(0x000000,.1); mSprite.graphics.drawRect(0,0,200,100); mSprite.graphics.endFill(); mSprite.graphics.beginFill(0x990000,.3); mSprite.graphics.drawRect(100,50,200,100); mSprite.graphics.endFill(); mSprite.x = (stage.stageWidth-mSprite.width)*.5; mSprite.y = (stage.stageHeight-mSprite.height)*.5; addChild(mSprite); -----Original Message----- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr, Theodore Sent: donderdag 25 februari 2010 13:58 To: Flash Coders List Subject: RE: [Flashcoders] finding x of sprite wow - this is something I am ging to have to wrapped my head around.... I set the x,y of the sprite at creation to: 15, 337 (with a w,h of 646,207) BUT the x/y traces as 0,0.... if I do: spret.x = 15; it moves it 15 as related to the original 15... so it is REALLY at 30 on the stage AND then when I move it 15 (which should really be 30) it traces to 15.... It just occired to me that maybe I should create it at 0,0 and then move it to where I want it to be.... ________________________________________ From: flashcoders-boun...@chattyfig.figleaf.com [flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Cor [c...@chello.nl] Sent: Thursday, February 25, 2010 7:38 AM To: 'Flash Coders List' Subject: RE: [Flashcoders] finding x of sprite Your sprite position is 0 and IN there, there is the rectangle at 15 px. trace(mSprite.width); // //set mSprite's x mSprite.x = 15; -----Original Message----- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Lehr, Theodore Sent: donderdag 25 februari 2010 13:29 To: Flash Coders List Subject: [Flashcoders] finding x of sprite given the following: var msprite:Sprite = new Sprite(); mSprite.graphics.beginFill(0x000000,.1); mSprite.graphics.drawRect(15,337,646,207); mSprite.graphics.endFill(); addChild(mSprite); trace("mSprite.x = "+mSprite.x); I would think that I should be tracing "mSprite.x = 15" instead I get "mSprite = 0" Anyone know why? _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2707 - Release Date: 02/24/10 08:34:00 _______________________________________________ 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 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 9.0.733 / Virus Database: 271.1.1/2707 - Release Date: 02/24/10 08:34:00 _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders