javascriptactionscript-3html5-canvasanimate-cc

Convert getClass from as3 to html5 canvas


I'm trying to convert my as3 project to html5 canvas using animate cc I have the as3 code below to clone MovieClip on stage and need it using html5 canvas.

function getClass(obj:Object):Class {
    return Class(getDefinitionByName(getQualifiedClassName(obj)));
 }
var mc=getClass(this.getChildByName("myMc"))

Solution

  • That's it :)

    stage.nn.gotoAndStop("cow");
    var mc=stage.nn.getChildAt(0).clone()
    mc.x=100
    mc.y=100
    stage.addChild(mc)
    

    Thanx All :)