Flash - play a video once

I try to play the video once on hover, it is currently repeating endlessly.

My ActionScript is as follows:

mc.stop();
mc.addEventListener(MouseEvent.MOUSE_OVER,mover);

function mover(e:MouseEvent):void
{
    mc.play();
}

How do I stop it after it's finished?

thank

+3
source share
3 answers

In the last frame of the movie clip, put a stop()in Actions

+4
source

I know this is an old topic, but for reference, there is another way to do this.

mc.addFrameScript(mc.totalFrames - 1, callbackFunc);

function callbackFunc()
{
    mc.stop();
}

This is good if you do not want to enter any code on your timeline. Here is a link for more information about awesomeness that addFrameScript.

+10
source

EventListener EXIT_FRAME , , Stop ( GotoAndStop), currentFrame .

+1

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


All Articles