PDA

View Full Version : button to control mc


kevbikemad
09-15-2003, 06:51 PM
Having a lot of trouble learning Action Scripts.

I have a movie, on load I want a MC to load (be visible) along with 4 different buttons. My intention is to make each of the 4 buttons control (play) 4 different MC that are already in the movie, not as seperate SWF files.

I've created a button and one MC to try to test. I would like to know how to make this movie clip be invisible and when the user clicks the button, then it plays.

My knowledge of Action Scripts is NA. I've assigned what I think should work, but it does not. If someone could look at the attached file and provide some clear assistance, that would be greatly appreciated.

webguy
09-15-2003, 07:04 PM
hello kevbikemad!

Welcome to the forums and welcome to actionscript. I made some subtle changes to your fla and I will briefly explain where you went wrong.

Inside of the fla, you had a button and inside of that button there are 4 frames corresponding to up,over,down, and hit. The later (hit) is where you define the area that will respond to the mouses over position. So if you only have text in there, it will only respond to the mouse being over the text (not the bounding area). It appears that you have learned that loosely. You put another button on that hit frame and tried to use that button. Unfortunately flash doesn't do buttons inside of buttons, as a hint to keep in mind though (Flash MX allows mc's to be buttons. So make an mc and apply button actions to it and have no worries :D ). So what I did was simple. I deleted your button inside of the button and defined the hitArea. Then I took your code and put it on the first button, so that it will work with it when it is pressed. Then I changed the code so it targets the bBox instance that is on stage. Clicking this buttons advances the playhead of bBox to frame 26. Let me know if you need further explaination, I'd be happy to help you further.

web