samedi 14 janvier 2017

Adobe Animate CC ActionScripts3 error

I'm trying to using StageWebView in Animate CC 2017, below error show when Test:

"Scene 1, Layer 'Layer 1', Frame 1, Line 1, Column 10 1037: Packages cannot be nested."

Document is empty, in frame 1 i added code.

 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 ); 
        } 
    } 
}

Aucun commentaire:

Enregistrer un commentaire