Flash: how can I temporarily disable or block all mouse events for an external SWF file

I have SWF files that are uploaded to my flash movie, and these SWF files sometimes have mouse events that can interfere with the dialogs and buttons in my flash movie. I would like to temporarily disable the handlers of the loaded SWF file handlers or block them from any effects on my flash movie. My flash movie is AS 2.

+3
source share
4 answers

A common solution to this problem in ActionScript 2 is what is often called the "blocker" clip. Just create a movie clip that consists of a fully transparent fill. Then you can place this movie clip wherever you want, and its size as needed. Finally, you assign this clip a dummy mouse event and disable its use of the hand cursor - like this:

blocker.onRelease = function() {};
blocker.useHandCursor = false;

While this clip is above the downloaded content, it will absorb any mouse events.

+5
source

Create an event handler at the moment when it is really necessary, for example, when a button or object falls into a frame.

If the clicks on the clicks of the event listener are already created, you can delete the listener at any time in ActionScript.

myButton.removeEventListener (MouseEvent.CLICK, handleMouseClick);

,

myButton.addEventListener(MouseEvent.CLICK, handleMouseClick);

"handleMouseClick" , - .

ActionScript , , , , - . , .

0

, SWF - -. - . - SWF AS2.

, AS2 AS3 SWF AS2.

0
source

You can also use the variable and check if the state "0" changes when the clickEvent function is called.

var lockScreen: int = 0;

Set lockScreen = 1if you want to ignore click events and return to zero after doing something. At least this works for me :)

0
source

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


All Articles