Playing video with StageWebView, how to stop video (without timer)?
I am using StageWebView to play some video's on a different (numbered) frame, and as of now they only way I can figure out how to kill the video and return to the previous frame is by using a timer to go back after a given amount of time. This is a bit of a hack, and not optimal, since I want users to be able to stop the video and go back at any time if they choose to. Any ideas?
Here's the code I currently have on the frame with the video...
import flash.geom.Rectangle;
import flash.media.StageWebView;
import flash.filesystem.File;
stop();
//Timer to next frame
var myTimer1:Timer = new Timer(48000);
myTimer1.addEventListener(TimerEvent.TIMER, fortyeightSec);
myTimer1.start();
function fortyeightSec(event:TimerEvent):void
{
webView1.stage = null;
myTimer1.stop();
MovieClip(root).gotoAndStop(4);
}
//Video Play
var webView1:StageWebView = new StageWebView();
webView1.stage = this.stage;
webView1.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
var fPath1:String = new File(new File("app:/objects.mp4").nativePath).url;
webView1.loadURL( fPath1 );
