tags:

views:

118

answers:

3

I want to get the top-right corner of an image in flex .... so far i can just get the x and y which are top-left by default .... sorry im a noob and if this is a dumb question

+1  A: 

Have you tried adding the image width to x?

Chry Cheng
A: 

Flex supports three coordinate systems as you will find here:

  • global
  • local
  • content

Depending on how your image is laid-out you will have to use the image.x and width values and an appropriate conversion function.

dirkgently
A: 

I'm not very involved in Flex but for flash AS2 I would do:

var top:Number
var right:Number

top = myImageObj._y
right = myImageObj._x + myImageObj._width

There might be a bit different in AS3 I think they have changed "._y" to ".Y" but I'm not sure.

Anyway the principle is the same. Use the top left and then just add the width to get the right edge

Charlie boy
Using AS3 syntax it would be like:top = myImageObj.y;right = myImageObj.x + myImageObj.width;
Ross Henderson