|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can anyone figure this out??
I have 5 movies with 10 frames in each I use for interactive buttons. All the movies are displayed at once.
When one is clicked it goes to frame 5, stops and displays an image. Same with the other 4 but displays a different image. This is what I want to happen: A movie(button) is clicked on, plays to frame 5 and displays an image and is sitting on frame 5. When another movie is clicked on, the previous clicked movie plays to frame 10 and goes back to frame one and the new clicked movie plays to frame 5. The problem is when a movie(button) is clicked how can I make the movie that is sitting on frame 5 to play. Does this make sense or is it utterly confusing. Hopefully someone will know. Thanks for any help. |
|
#2
|
|||
|
|||
|
First put stop(); on frame 1 and 5 of your clip.
Next put this in the event that you want to trigger your button (Release, Press, etc). Code:
if (lastButton != this._name) {
_root[lastButton].gotoAndPlay(5);
_root.lastButton = this._name;
b1.gotoAndPlay(1);
}
lastButton is a variable on the _root timeline that stores the instance name of the last button that was clicked. When a different button is clicked, the last button is told to play from frame five. We also have an if statement being used to make sure that the last button is not the same as the button currently being pressed before we execute the rest of the code. Hope that helps. |
|
#3
|
|||
|
|||
|
What is the b1??
|
|
#4
|
|||
|
|||
|
b1 was just the name of the movieClip. You could replace it with "this" if you wanted.
You would put that code in the movieClips onRelease and onReleaseOutside actions. That is assuming you have MX. If you don't then you'll have to put the code in the movieClip's onMouseUp event and use a hitTest to determine if the mouse is over the clip or not. Usually if the keyword "this" is used in the code, it means the code goes in the actions of the object that is using it. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Can anyone figure this out?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|