Flash Trouble

  • Jefferx
  • Born
  • Born
  • No Avatar
  • Joined: Dec 11, 2004
  • Posts: 3
  • Status: Offline

Post December 11th, 2004, 1:40 am

Hello Started making a Flash weboage for a Friend of mine and i ran into a bit of trouble. with buttons, i am using Flash mx, Ok here i need help on i have a button its calle buttonenter and i want when it is click to go to the next scene i have this for the code:

buttonenter.addEventListener("click",gotoAndStop(2,1);
);

Next i want this button on the secound scene to start a instances i have this for the code:

Play button.addEventListener("click",play(symbol 8);
play(symbol 9););

and fianlly a button to do the oppisite of that
Stop button.addEventListener("click",stop(Symbol 8);
stop(Symbol 9); )


please help me out thanks
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post December 11th, 2004, 1:40 am

  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Joined: Oct 12, 2004
  • Posts: 861
  • Loc: BKNY
  • Status: Offline

Post December 11th, 2004, 3:06 pm

Your e-mail is a little confusing, so if I don't answer your questions, please write back with more clarification, like:
Quote:
Next i want this button on the secound scene to start a instances i have this for the code:

That's really confusing. What are the instance names? Emoticons are not valid instance names, so it's hard to give you good script. Also, what kind of symbols are they (graphics, buttons, movieclips?)
And, maybe, start from the begining and describe what you want.

Now that that's out of the way - here's what I think will help:

First off, I think that "addEventListener" is only valid for movieclip instances and there's a much easier way to do what you want to do.

just select the button and, in the actions space, just write:
Code: [ Select ]
on(release){gotoAndStop(2,1);}


Next, make sure you don't have any spaces (such as "Play button")
And I'm asssuming that you have a movieclip "symbol9" that has some frames in it that you want it to play when the user clicks the button.
select the button in question and:
Code: [ Select ]
on(release){_root.symbol9.play();}


now, select the stop button and:
Code: [ Select ]
on(release){_root.symbol9.stop();}


Good luck,
puck
  • Jefferx
  • Born
  • Born
  • No Avatar
  • Joined: Dec 11, 2004
  • Posts: 3
  • Status: Offline

Post December 11th, 2004, 4:02 pm

Woot thanks man you help me out so much, i knew i was forgeting the one key thing lol. ok a few more questions

Ok on the button to start i want it to start playing the music i put
on(release){_root.symbol1.play();}

but on the stop i put
on(release){stopAllSounds();}

when the page loads the music starts playing when i clikc stop it stops when i hit start nothing happen.

you can view the page here:
http://www.pinnaclemarketing.org/jefferx3/index.htm
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Joined: Oct 12, 2004
  • Posts: 861
  • Loc: BKNY
  • Status: Offline

Post December 11th, 2004, 5:15 pm

ahhh... so you're working with a sound clip...

okay... so i'm assuming that speakers are "symbol1"

what i would do is go into "symbol1" and set it up so that on the first frame of "symbol1", the sound loads.
set it up so it repeats, like this...
you've got a 2 frame movie, right?
now, make it 4 frames. just copy the frames you've got an paste 'em right after themselves.
on the third frame, in an actions layer, create a keyframe with this script:
Code: [ Select ]
gotoAndPlay(2);

then, on the fourth frame, put this script:
Code: [ Select ]
stop();
stopAllSounds();
  1. stop();
  2. stopAllSounds();


that will make it so that the sound loads once in the symbol1 movie. the movie loops like you've got it now, but you don't have to worry about the sound loading over and over again and getting all tripped out.

now, back to the main movie.

on the "play" button, put this script:
Code: [ Select ]
on(release){_root.symbol1.gotoAndPlay(1);}

and on the "stop" button, put this script:
Code: [ Select ]
on(release){_root.symbol1.gotoAndPlay(4);}


this will allow you to stop by going to a frame within symbol1 with the stopAllSounds code in it and, when you want to play the music again, go to a frame that loads the music again... aight?

another tip - make sure you've got stop(); at the end of your movie. i'm not sure what's going on, but if you wait a minute after pressing the "Stop" button, the music comes back on.

peace,
puck

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 32 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.