David Edeburn’s Code Snippets for Flash Canvas

I’m going to add code snippets here for basic banner ad functionality coded in Javascript or CreateJS for use inside of the Flash Canvas environment.

Here’s how to hide / show the mouse cursor inside of flash.

// Hide the mouse cursor

stage.canvas.style.cursor = “none”;

//Show the mouse cursor

stage.canvas.style.cursor = “default”;

If you need to manage the visibility or control an object that exists on the timeline of the flash canvas document you need to do the following.

// create a variable and assign it to the stage – on the root timeline

var mainStage = this;

// name an instance on the root timeline of the document – in this case a movieclip named button //with an instance name of “myButton”

// then assign properties to it with the following language

mainStage.myButton.visible = “false”;

// This will hide your button