如何在Flash Professional的.ipa应用程序中显示StageWebView页面

如何在Flash Professional的.ipa应用程序中显示StageWebView页面,flash,stagewebview,Flash,Stagewebview,我需要在一个小应用程序中显示一个.mp4文件,我正在用Flash Professional CC为iPad构建这个应用程序。最好的方法是StageView,但我无法让它发挥作用。我找到了一些应该执行该技巧的代码,但我不断地得到错误:1180:调用一个可能未定义的方法文件 谁能帮我一下吗 var webView = new StageWebView(); webView.stage = this.stage; webView.viewPort = new Rectangle( 0, 0, stag

我需要在一个小应用程序中显示一个.mp4文件,我正在用Flash Professional CC为iPad构建这个应用程序。最好的方法是StageView,但我无法让它发挥作用。我找到了一些应该执行该技巧的代码,但我不断地得到错误:1180:调用一个可能未定义的方法文件

谁能帮我一下吗

var webView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight);
var path:String = new File(new File("app:/path/file.html").nativePath).url;
webView.loadURL("app:/path/file.html");

您可以在iOS中使用stagewebview播放.mp4视频。请按照以下步骤进行操作

    var webView = new StageWebView();
    webView.stage = this.stage;
    webView.viewPort = new Rectangle( 0, 0, stage.stageWidth,   stage.stageHeight);
    var videoFile : File = new File( File.applicationStorageDirectory.resolvePath( "/enter/the/file/path/here" ).nativePath ); //Make sure your .mp4 is located in local store.

    if( videoFile.exists ) //To check file is exist or not
        webView.loadURL( videoFile.url ); //Here given .mp4 file will play using ios native player
如果文件在应用程序本地存储中, 如: [app_name]/Local Store/video.mp4

var videoFile : File = new File( File.applicationStorageDirectory.resolvePath( video.mp4 ).nativePath;
var path : String = ( videoFile.exists ) ? videoFile.url : "";
注:

Application Directory = File.applicationDirectory.resolvePath("file/path/application/directory");
Documents Directory = File.documentsDirectory.resolvePath("file/path/in/documents");
User Directory = File.userDirectory.resolvePath("path/from/user/");