basically what i want is to make one picture change to another picture when the enter key is pressed. then i want it to change back when the enter key is released. don’t want to use a mouse click to do this so a button isn’t what i need. can anyone help?
This will check if the key that is being pressed down is the enter button, then it will gotoAndStop at frame 2, which will be your image when the button is pressed. The else statement states that if the enter button is not pressed, or any other button is being pressed, the movie clip will say on Frame 1, the original image.
be aware that ENTER in the flash authoring environment, when previewing a movie means Play (see the control menu). To see how it would accurately play, open the swf outside of flash to test
it all depends on how your movie is set up. The ENTER is recognized, but if you are stopped on a single frame in _root where this clip exists, using ENTER will make _root play, and unless that clip continues to exist outside of that frame for the following frames which are now being played in _root, you’ll lose it.
I wasnt trying to prove you wrong lost it was just a precaution
hate to break you two up
but how about if i want the enter key to also play a mp3 sound to go along with the action? how would i set that up? thanks again
its the best way, given the situation, to accomplish the task.
it prevents any need to link the file which would cause it to be exported early in the movie (possibly messing with preloaders as you pointed out) and runs completely fine without the need of any potentially confusing code. Afterall the gotoAndStop example wasnt exactly brain surgery which would lead us to believe that diseased013 is a novice in terms of AS coding which makes the ease of this method more than favorable.
And luckily, depsite the posibility of a repetitious nuisance via keyboard key itteration (and therefor frame itteration) the nature of the 2 framed clip and gotoAndStop prevents that from occuring.
I actually applaud lostinbeta because I probably would have suggested something scripted
It actually means a lot that you agree with me here. I still consider myself a novice in Flash (approx 7 months, 6 with AS) and tend to go about doing things the hard way (in case you haven’t noticed), but I think I am catching on.
One day I aspire to be a strong coder, but that day is far away, I can tell.
Well yeah, but there are mostly newbies in this forum too though, so it is easier to be more knowledgable
I still think I am ahead of some other people that have been using Flash for the same amount of time, but there are also people that know much more than I in the same amount of time.
I guess it depends on the speed you learn at, I am a fast learner, but take my time experimenting with what I learn before I move on.
hmm. that didn’t work. here’s the deal. what i’m working on is basically a game. i have background music that IS playing so stopAllSounds on frame 1 will stop the music from playing. placing the effect sound on frame 2 didn’t change anything. it still doesn’t play when enter is pressed. any ideas what could be wrong?
whooooaaa. heh nevermind. we figured it out. needed to put it on a new layer. alright new question. how can i change the title bar in the player to read something other than “Flash Player 6.0”?
and for the record. i’m not a “newbie” just haven’t messed with flash since like version 3
alright we have the sound going…but we can’t stop the sound from overlapping when you hold down the Enter key, and using stopAllSounds, as said earlier, will stop the music. any ideas
I don’t know how to manipulate anything with the standalone player, I never use it (for presentations at least), so I never tried it.
And last but not least, no one said you were a newbie, I stated that the board was filled with newbies (since this is a tutorial site for starters in Flash and all) and Senocular stated that you might have been a novice (step up from newbie) with AS. And being you said you haven’t messed with Flash much since version 3, I think I am going to assume the same thing since the AS scheme has changed incredibly with MX since version 3.