Adding mouse functionality to bitmap images


show more Adding mouse functionality to bitmap images provides you with in-depth training on Developer. Taught by Todd Perkins as part of the ActionScript 3.0 in Flash Professional CS5 Essential Training show less
please wait ...

Adding mouse functionality to bitmap images

The bitmap class doesn't come with support for interactivity, like mouse clicks. In order to make an image clickable, you'll need to take a few extra steps. Now, think of the bitmap class in ActionScript just like a bitmap on the Stage. So, if I go to the library and I click and drag this boats image onto the Stage, like so, I select it, I can see that it's a bitmap in the Properties panel. So, when I work with a bitmap it's a little bit different than working with, say a movie clip or a button.

I can't give it an instance name, so I can't add things like mouse interactivity. So that's the same as it is in code. Let's go to the first keyframe of the actions layer and open up the Actions panel. So if I were to type bmp. addEventListener and MouseEvent.CLICK, capital M, capital E, and then CLICK in all caps, and I were to run a function called bitmapClicked, I create the function now, so bitmapClicked, capital C, in the parentheses to event:MouseEvent, capita...

Adding mouse functionality to bitmap images
Video duration: 3m 31s 7h 8m Beginner Updated May 23, 2012

Viewers:

Adding mouse functionality to bitmap images provides you with in-depth training on Developer. Taught by Todd Perkins as part of the ActionScript 3.0 in Flash Professional CS5 Essential Training

please wait ...