I'm trying to build an App for iOS using Flash Pro CS5.5, I need to implement a simple video on one of my pages and I'm having trouble controlling it. After a few hours of googling I finally managed to get a video working and running without hitches onto the page but I still can't get my head around a few things:
- How can I prevent it from auto playing? I see no options or vars that I can change to prevent it from playing as soon as the app is loaded up
- Is it possible to nest stageWebView within a MovieClip? Right now it just loads right on top of everything, is it possible to have it move/scale/fade/etc. I imagine it would be something to do with where I set the stage or viewPort but I can't figure it out.
The following is my code:
import flash.geom.Rectangle;
import flash.media.StageWebView;
import flash.filesystem.File;
var webView:StageWebView = new StageWebView();
var path:String = new File(new File("app:/video.mp4").nativePath).url;
videoBtn.addEventListener(MouseEvent.CLICK,videoOpen);
videoBtn.buttonMode = true;
videoBtn.alpha = 0;
function videoOpen(event:Event = null):void{
webView.stage = this.stage;
webView.viewPort = new Rectangle(100, 100, 600, 480);
webView.loadURL(path);
}
videoBtnStop.addEventListener(MouseEvent.CLICK,videoClose);
videoBtnStop.buttonMode = true;
videoBtnStop.alpha = 0;
function videoClose(event:Event = null):void{
webView.viewPort = null;
webView.dispose();
webView = null;
}