vendredi 23 septembre 2016

Converting AS3.0 to HTML5

I'm using Adobe Flash Pro CC, and nothing is loading into the canvas, I know its my loader, but not sure what I have done wrong:

this.stop();
this.addEventListener(Event.ENTER_FRAME, this.loading);

private function loading():{
var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;

    if (total == loaded){
        this.removeEventListener(Event.ENTER_FRAME, this.loading);
        this.gotoAndPlay(3);
    }

}

This was the AS3

stop();
this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void{
var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;

    if (total == loaded){
        this.removeEventListener(Event.ENTER_FRAME, loading);
        this.gotoAndPlay(3);
    }

}

Aucun commentaire:

Enregistrer un commentaire