Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 Adobe Animate CC ActionScripts3错误_Actionscript 3 - Fatal编程技术网

Actionscript 3 Adobe Animate CC ActionScripts3错误

Actionscript 3 Adobe Animate CC ActionScripts3错误,actionscript-3,Actionscript 3,我尝试在Animate CC 2017中使用StageWebView,测试时显示以下错误: 场景1,第1层,第1帧,第1行,第10 1037列:包不能嵌套 文档为空,在第1帧中我添加了代码 package { import flash.display.*; import flash.geom.Rectangle; import flash.media.StageWebView; public class WebView extends Sprite

我尝试在Animate CC 2017中使用StageWebView,测试时显示以下错误:

场景1,第1层,第1帧,第1行,第10 1037列:包不能嵌套

文档为空,在第1帧中我添加了代码

 package { 
    import flash.display.*; 
    import flash.geom.Rectangle; 
    import flash.media.StageWebView; 
    public class WebView extends Sprite 
    { 
        public var webView:StageWebView = new StageWebView(); 
        public function WebView() 
        {     
            var htmlString:String = "<!DOCTYPE HTML>" + 
            "<html><script type=text/javascript>" + 
            "function callURI(){" + 
            "alert(\"You clicked me!!\");"+ 
            "}</script><body>" + 
            "<p><a href=javascript:callURI()>Click Me</a></p>" + 
            "</body></html>"; 
            webView.stage = this.stage; 
            webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight ); 
            webView.loadString( htmlString ); 
        } 
    } 
}
包{
导入flash.display.*;
导入flash.geom.Rectangle;
导入flash.media.StageWebView;
公共类WebView扩展了Sprite
{ 
public var webView:StageWebView=new StageWebView();
公共函数WebView()
{     
var htmlString:String=”“+
"" + 
“函数callURI(){”+
“警报(\“你点击了我!!\”);“+
"}" + 
“

”+ ""; webView.stage=this.stage; webView.viewPort=新矩形(0,0,stage.stageWidth,stage.stageHeight); 加载字符串(htmlString); } } }
不应将类作为框架脚本放置。在*.fla源所在的同一文件夹中创建WebView.as文件,然后将其分配为根文档文件>发布设置>AS3设置>文档类>WebView旧文件,但它会为您提供有关该过程的可视提示。注:timeline中的代码已经在一个包中,并且有自己的,所以不要添加额外的代码,上面写着“使用名为webView的类创建我的新包”,现在一个应用中有两个包,这会出错。只保留导入、变量和函数,这样它就可以工作了。确保你正在编译一个AIR应用程序。好的,我做到了。错误未出现,但未显示任何内容。空白屏幕。我为windows和android编译,仍然是空白页面。请添加地址@AliKazemi,让我们知道您尝试了哪些建议。