Help: read a video 3 times and a link to a Web site

I need help with two things: (1) how to limit a loop of 3 plays and (2) how to GET the URL for the code to work so that when someone clicks on the video, a new window opens with the Web site.

My Flash CS6 file is set up quite simply: I FLVPlayback on a layer in the timeline panel, with an instance of the 'player' and on a separate layer name of AS3, I have the following code in the Actions window:

loop video but limit to 3 times

Player.source = "Mt.m4v";

Fl.video import. *;

function onFLVComplete (event:fl.video.VideoEvent): void

{

Player.Play ();

}

player.addEventListener (fl.video.VideoEvent.COMPLETE, onFLVComplete);

When the user clicks on the video, they will go to a Web site

import flash.events.MouseEvent;

import flash.net.URLRequest;

var myURL:URLRequest = new URLRequest ("http://www.google.com/");

function gotoURL(event:MouseEvent):void

{

navigateToURL (myURL, "_blank");

}

player.addEventListener (MouseEvent.CLICK, gotoURL);

you will need a skin because it is the only clickable part of a flvplayback component (add an alpha = 0 button on the playback screen) and use:

loop video but limit to 3 times

Player.source = "Mt.m4v";

Fl.video import. *;

var loop: int = 0;

function onFLVComplete (event:fl.video.VideoEvent): void

{

{if(Loop==2)}

gotoURL (null);

} else {}

Player.Play ();

loop ++;

}

}

player.addEventListener (fl.video.VideoEvent.COMPLETE, onFLVComplete);

When the user clicks on the video, they will go to a Web site

import flash.events.MouseEvent;

import flash.net.URLRequest;

var myURL:URLRequest = new URLRequest ("http://www.google.com/");

function gotoURL(event:MouseEvent):void

{

navigateToURL (myURL, "_blank");

}

player.addEventListener (MouseEvent.CLICK, gotoURL);

Tags: Adobe Animate

Similar Questions

Maybe you are looking for