How to click a display object in Flash using AS3?

I am creating a photo editor application where, at some point, the picture you are editing should be dropped between the two DisplayObjects layers (background image and image mask).

However, there is a problem. When the image you are editing is discarded between the background and the layers of the image mask, it becomes invisible and therefore gets stuck there, without being able to drag it again. (The photo editor uses the TransformManager library.)

I am looking for a way to let you select the image you are editing, regardless of whether there is another DisplayObject on top of it. And that probably means finding a way to click on the image mask.

Is there any way to do this?

I tried setting mouseChildren = false to imageMask, but this did not have the desired effect.

Many thanks.

+3
source share
7 answers

How about this?

mask.mouseEnabled = false;

+8
source

I had similar problems and managed to solve this problem using how

 displayobject.mouseChildren = false;  

and

displayobject.mouseEnabled = false;  

on the object you want to click.

+9
source

, GetObjectsUnderPoint, , , .

: !this.YourPhoto.hitTestPoint(stage.mouseX, stage.mouseY, false)

+2

, , as2.

-, , - , , .

, , ( hitTest, , ).

0

, senocular , , handleUpdate. : , mousePoint, .

0

I had a strange error that I used;

movieClip.mouseEnabled = false;

but for some reason didn’t work .. driving me crazy !! how i used it so many times. I tried a lot of different things, it didn’t work, I deleted MovieClip and created a new one and it worked .. so the contents of MovieClip should have been corrupted or something similar to the old dynamic block of the text area built into MovieClip.

hope this helps someone out there.

0
source

Source: https://habr.com/ru/post/1716640/


All Articles