View Full Version : I'm stupid
iksolovonop
06-12-2006, 10:20 PM
I am trying to make an interactive version of my room where you can click on the computer, lights, etc. and have something happen. Right now I'm trying to make it so that when you click on the computer a light turns on and the monitor shows something. I know this is simple, but how do I make it so that it will go to another frame? Everything I try says that the action I used can only be used by a button, then I can't get the button to do the right thing. Thanks
anticonnor
06-13-2006, 03:38 AM
It sounds like you may be trying to put your button actions on a frame, instead of on the button itself. I, personally prefer to put actions on frames instead of objects, just so my code isn't scattered everywhere. But you have to word things a little differently when putting your button actions on a frame instead of an object.
Make your scene with each object having it's various on/off states. Make sure to put stop actions on these on/off states so the playhead won't skip right by them. Label your moniter instance moniter_btn. Put this code in your frame:
this.moniter_btn.onRelease = function() {
this.gotoAndStop("moniter_on");
};
If you want more than one thing to be affected by your moniter_btn, just add it in the function.
You can usually find answers to simple questions like this with a quick search.
Good luck!
iksolovonop
06-13-2006, 11:11 PM
Just for future reference, what would I put in a search to find out about this? Button functions? I couldn't figure out what it would be called.
anticonnor
06-13-2006, 11:26 PM
I usually take a quick look at the Flash help files before I start searching online. In the help files you will find examples of pretty much every way a button can be created/used. If it came down to searching online you might try 'button', 'gotoandplay', 'gotoandstop', 'function'... these are all pretty common words and may produce a lot of results, but you just gotta dig.
Also look in people's topics that aren't completely related to yours; there's always the chance that they've done something similar to what you want in their code, and in a way you wouldn't have thought of.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.