What is the difference between onMouseUp / Down and onPress / Release events in Flash?

In Flash, there seem to be two sets of mouse click events:

  • onMouseUp, onMouseDown
  • onPress, onRelease

Is there any actual difference between these events? I cannot tell from the documentation, and I did not notice anything in actual use, but it seems strange to have two different sets of names for the same main events. Am I missing something? Is there any difference between the two?

Clarification: this is ActionScript 2 code targeting Flash 8.

+3
source share
5 answers

onMouseDown and onMouseUp are common events that can be heard through Mouse.addListener (). They fire regardless of where the mouse is clicked.

onPress onRelease MovieClip. , , MovieClip. onReleaseOutside... , MovieClip, , . onRelease, onReleaseOutside, , , , .

+5

- - , . MC ( ), Press, MouseDown. , , MouseDown, ( ).

+4

-, Windows .

, MouseUp/Down . A Press/Release .

+1

, :

http://www.gogoat.com/2006/07/27/onpress-vs-onmousedown/

It seems that mouseUp / mouseDown events will fire even if the mouse is outside the clip, and onPress / Release automatically checks to see if the mouse is in the clip before processing it. I could have sworn I experienced this, but I just tested it, so it shouldn't be.

+1
source

onPress and onRelease retain control over the AS2 code, they were supplanted by onMouseDown and onMouseUp in AS3, which you can read about in the AS2 Migration Guide .

-1
source

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


All Articles