Loading SWF in Adobe Animate CC HTML5 canvas

659 views Asked by At

I am converting a SWF file to HTML5 and want to load it in HTML5 for Adobe Animate CC HTML5 canvas.

In ActionScript 3 (SWF), I use the following code:

import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;

import flash.display.Loader;
import flash.net.URLRequest;

btn_name.addEventListener(MouseEvent.CLICK, loadComplete);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadComplete(event:MouseEvent):void
{
    loader.load(new URLRequest("http://~~~/content.swf"));
    addChild(loader)
}

and I convert it to HTML5 (Adobe Animate CC HTML5 canvas) with:

import flash.events.Event;
import flash.events.IOErrorEvent;
import flash.events.SecurityErrorEvent;

import flash.display.Loader;
import flash.net.URLRequest;

this.btn_name.addEventListener("click", loadComplete.bind(this)); 
var loader:Loader = new Loader();  
loader.contentLoaderInfo.addEventListener("complete", loadComplete);

function loadComplete()
{
    loader.load(new URLRequest("http://~~~/content.swf"));
    this.addChild(loader);
}

but it's not working.

What should I do to load the SWF file into the HTML5 canvas?

0

There are 0 answers