javascript - Converting AS3 to HTML5 Canvas -


i'm struggling convert javascript in flash cc. need in html5 canvas.

but flash comment out script:

stop();  function findframe(event:event):void{ var frame:int = math.floor((stage.mousex/stage.stagewidth) * 900) + 1; gotoandstop(frame); };  addeventlistener("enterframe",findframe); 

what move movieclip frame 1 frame 900, depending on mouseposition in x (horizontal direction).

i tried convert it:

this.stop();  function findframe(event:event):void{ var frame:int = math.floor((stage.mousex/stage.stagewidth) * 900) + 1; gotoandstop(frame); };  addeventlistener("enterframe",findframe); 

but no luck, warning:

warnings: frame numbers in easeljs start @ 0 instead of 1. example, affects gotoandstop , gotoandplay calls.

any expert can me on this? :-)

did check console output? expect syntax error dropped in line:

var frame:int = math.floor((stage.mousex/stage.stagewidth) * 900) + 1; 

:int type definition - , don't exist in javascript.


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -