If I stop the animation immediately after adding it to the scene, then the movie clip is visible but the listener does not work. If I do not stop, then the movie is NOT visible, but the listener works and plays the animation. True, it works to the right of the x coordinate

public class PlayScreen extends Sprite { var cell:MovieClip; var cellSize:int = 45; public function PlayScreen() { super(); cell = new Cell_mc(); cell.width = 45; cell.height = 45; cell.x = 100; cell.y = 100; addChild(cell); cell.stop(); cell.addEventListener(MouseEvent.CLICK, onCellClick); } function onCellClick(e:Event):void { trace("Управление передается!"); e.target.play(); e.target.removeEventListener(MouseEvent.CLICK, onCellClick); } } 

What the hell is going on ???

    1 answer 1

    Most likely, it's in the movieclip itself, try to make a new movie with simple animation and see if the problem remains.

    It may also be that the movie you have an object of the class SimpleButton, that is, when you created it in a flash, you made it with a button (you can see it in the movie settings). Inside it looks like this:

    In the first frame is the graphics for the normal state, in the second for the state when the mouse is over the button, in the third for the state when the mouse is clicked and in the fourth lies the hitzone. If there is something in the hitzone, then the mouse will react (pointing, pressing) only to the area that is drawn in this frame, regardless of what is drawn in the first three frames. This could explain the fact that the mouse is triggered to the right of the movie coordinates.

    If this does not help, then you need more information, the screen of the movie with its timeline, how you make the movie into a code, and so on.