vendredi 23 septembre 2016

Converting AS3.0 to HTML5

The situation is I have aworking AS3 animation with some basic actions, I need to embed in a HTML5 Captivate (this is what I'm good at, as you can tell its not coding). I attempted (poorly) to use the http://ift.tt/2cTkJWN to convert to HTML5. The first first keyframe is the loader from AS3, the second key frame is has some animations that are actioned by a button and the 3rd is the animation. Any help with the below would be massively appreciated.

At the moment the canavs is loading blank so i can't even tet teh button works.

What is the easiest changes I can make to this action on keyframe 1 so it jumps to the play (I don't need a loader as HTML5)?

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

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

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

Working AS3 from keyframe 1:

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

Animations, I think there is no change here:

mouthmc.play();
eyesmc.play();

Button, I think I converted this OK?:

textmc.mouseEnabled = false;
    this.theButton.addEventListener("click", clickHandler(this));  
    function clickHandler()
    {
        planeflightmc.gotoAndPlay("end");
     cloudmc.gotoAndStop(1);
     this.gotoAndStop(3);
    }

Note all editing is in Animate CC

Aucun commentaire:

Enregistrer un commentaire