Basic Scripts HTML Canvas
- Stopping a video
this.stop();
- Inserting Video
video = document.createElement('video');
video.src = 'video.mp4'; video.autoplay =true; video.controls=true;
video.volume = 0; var Video = new createjs.Bitmap(video); stage.addChild(Video);
stage.x = 100;
stage.y = 100;
- Clicking a button to jump to a place in the timeline
this.button.addEventListener("click", fl_ClickToGoToAndStopAtFrame.bind(this));
function fl_ClickToGoToAndStopAtFrame()
{
this.gotoAndStop(32);
}
- *Note...you can also name a frame and jump to that so it doesn't need to be a specific number
this.gotoAndStop("movie");
- Control the timeline inside a symbol (for example - button hover and mouse out events)
var frequency = 3;
stage.enableMouseOver(frequency);
this.button.addEventListener("mouseover", fl_MouseOverHandler.bind(this));
function fl_MouseOverHandler()
{
this.button.gotoAndPlay(1);
}
var frequency = 3;
stage.enableMouseOver(frequency);
this.button.addEventListener("mouseout", fl_MouseOutHandler.bind(this));
function fl_MouseOutHandler()
{
this.button.gotoAndPlay(16);
}
- *Canvas starts at 0 so the numbers are offset by 1...if you want to play frame 2 use 1
- Actionscript code is more straightforward. I had to research most of these on line and code snippets didn't quite do the trick