Re: [Flashcoders] { AS3 } Reading position info X, Y, H W
Do you know the rotation? 2 ways to do this: Either rotate the image back to 0 if it can be done - if you do this you will need to call validateNow() on the instance after changing values, read the new w2, etc. then rotate it back... Or do some pythagoras w2 is the hypotenuse of one triangle. h2 is the hyp of another... You can work the rest out :) Glen [EMAIL PROTECTED] wrote: Hi i need some help reading position info X, Y, H W of a desired object. Now i know some of you are going to jump streight in with answeres like... instanceName.y, instanceName.x etc... but i would like you to take a look at the following link first, you will see a number of lines drawn to explanin the valuse i am after! http://79.170.40.163/flashdev.com/ I already have X, Y bounding box H/W values. I need to read W2, H2 X2 if possible? Regards SM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] { AS3 } Reading position info X, Y, H W
Surely - by Pythagoras w2 = square root of (width - x)^2 + (x2 - x)^2 Also might help to know the _rotation angle of the containing element -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: 28 April 2008 14:43 To: Flash Coders List Subject: [Flashcoders] { AS3 } Reading position info X, Y, H W Hi i need some help reading position info X, Y, H W of a desired object. Now i know some of you are going to jump streight in with answeres like... instanceName.y, instanceName.x etc... but i would like you to take a look at the following link first, you will see a number of lines drawn to explanin the valuse i am after! http://79.170.40.163/flashdev.com/ I already have X, Y bounding box H/W values. I need to read W2, H2 X2 if possible? Regards SM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] { AS3 } Reading position info X, Y, H W
Yeah i know what the rotastion is, but am not sure what to do with regards to pythagoras and working out the hypotenuse. Can you point me to any examples of how to use validateNow() as ive looked through Flash Help/Livedocs and cant seam to figure out how its used! SM - Original Message - From: Glen Pike To: Flash Coders List Sent: Monday, April 28, 2008 2:55 PM Subject: Re: [Flashcoders] { AS3 } Reading position info X, Y, H W Do you know the rotation? 2 ways to do this: Either rotate the image back to 0 if it can be done - if you do this you will need to call validateNow() on the instance after changing values, read the new w2, etc. then rotate it back... Or do some pythagoras w2 is the hypotenuse of one triangle. h2 is the hyp of another... You can work the rest out :) Glen [EMAIL PROTECTED] wrote: Hi i need some help reading position info X, Y, H W of a desired object. Now i know some of you are going to jump streight in with answeres like... instanceName.y, instanceName.x etc... but i would like you to take a look at the following link first, you will see a number of lines drawn to explanin the valuse i am after! http://79.170.40.163/flashdev.com/ I already have X, Y bounding box H/W values. I need to read W2, H2 X2 if possible? Regards SM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ 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
Re: [Flashcoders] { AS3 } Reading position info X, Y, H W
Hi, Sorry I see you are using Flash not Flex, I gotta stop doing that. If you are using Flash, just changing the rotation should work straight away - you will see it on screen - don't worry about validateNow() (If you are using Flex and change properties of a UIComponent, you may need to call validateNow on that component before it updates the display, hence other properties.) To be honest, Pythagoras is easier and more robust than this and if you are programming graphics, it should be in your arsenal - see the other guys' reply for a solution, but have a go at working it out first if you can. Glen SJM - Flash wrote: Yeah i know what the rotastion is, but am not sure what to do with regards to pythagoras and working out the hypotenuse. Can you point me to any examples of how to use validateNow() as ive looked through Flash Help/Livedocs and cant seam to figure out how its used! SM - Original Message - From: Glen Pike To: Flash Coders List Sent: Monday, April 28, 2008 2:55 PM Subject: Re: [Flashcoders] { AS3 } Reading position info X, Y, H W Do you know the rotation? 2 ways to do this: Either rotate the image back to 0 if it can be done - if you do this you will need to call validateNow() on the instance after changing values, read the new w2, etc. then rotate it back... Or do some pythagoras w2 is the hypotenuse of one triangle. h2 is the hyp of another... You can work the rest out :) Glen [EMAIL PROTECTED] wrote: Hi i need some help reading position info X, Y, H W of a desired object. Now i know some of you are going to jump streight in with answeres like... instanceName.y, instanceName.x etc... but i would like you to take a look at the following link first, you will see a number of lines drawn to explanin the valuse i am after! http://79.170.40.163/flashdev.com/ I already have X, Y bounding box H/W values. I need to read W2, H2 X2 if possible? Regards SM ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ 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 -- Glen Pike 01326 218440 www.glenpike.co.uk http://www.glenpike.co.uk ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders