charles.crepin,
[quoted text, click to view] > You have your 2 images? The normal one and the lighted
> one? Just switch between them with a button.
Of course! And yet, if someone doesn't know how to make that switch, or
how to program a button, it's not so easy, right? Generally speaking, a
button (or movie clip) can be programmed like this.
1) Select the button on the Stage by clicking it.
2) Look at the Property inspector.
3) Give the button an instance name.
Now that it has an instance name, it can be "spoken to" by ActionScript
and told what to do. In a keyframe, enter the following ActionScript:
myButton.onRelease = function():Void {
// code here
}
Replace "myButton" with the instance name you just gave the button.
You're assigning a function to the Button.onRelease event (or
MovieClip.onRelease event, if it's a movie clip) of the button in question.
Now all you have to do is replace that "code here" area with what you
really want it to do.
I would set up both images -- the one with lights on, and the one with
lights off -- over top of each other. Make the top one, at least, a movie
clip, so that you may also give it an instance name. Notice that the
MovieClip class features a MovieClip._visible property (see the class entry
in the ActionScript 2.0 Language Reference for all available properties
[characteristics], methods [things it can do], and events [things it can
react to, such as onRelease].)
Assuming the "lights off" image (now a movie clip) is on top, or on a
layer above the "lights off" image, you may reference its instance name and
turn its visibility off like this ...
myButton.onRelease = function():Void {
lightsOff._visible = false;
}
.... again, assuming the instance name of the button is "myButton" (otherwise
change the code) and the instance name of the "lights off" movie clip is
lightsOff.
David Stiller
Adobe Community Expert
Dev blog,
http://www.quip.net/blog/ "Luck is the residue of good design."