The Team Jackulator Forums
April 25, 2024, 02:28:57 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
   
   Home   Help playlist Arcade Search Media Downloads Login Register  
The Jackulator 9000 Forums
Pages: [1]   Go Down
  Send this topic  |  Print  
This topic has not yet been rated!
You have not rated this topic. Select a rating:
Author Topic: How to make a button?s audio stop when another button?s audio is triggered?  (Read 2756 times)
0 Members and 1 Guest are viewing this topic.
Shhhhh
MISSING IN ACTION
baby jack
*
Offline Offline

Posts: 3


Awards
« on: January 03, 2010, 01:54:15 pm »

Hi, hope it's OK to start a new thread? I'm just a little stuck on something...

I?m here at my pal?s, Macromedia Flash MX 2004 running. I have no experience at all with flash but by following instructions from the web I?ve managed to create two one-layered buttons (that trigger the appropriate audio) and a stop button. When I roll the mouse over the buttons they change colour, and again to another colour when clicked. I am able to stop the audio by clicking the stop button or by pressing the keyboard?s spacebar.

All is perfect apart from one thing? For example, at the moment if I trigger the audio from, say, button 1 and then click on button 2, the audio from button 1 will keep playing and overlap button 2?s audio, if that makes sense. I would like to write an action script in the buttons which makes the audio from one button stop when another button?s audio is playing, so there?s no overlap.

I tried writing for button 1:

on (press) {
stopAllSounds();
}

but this just makes button 1 into a stop button, no audio; if I click button 2, then button 1, button 1 stops button 2?s audio, but button 1 has no audio of its own with the above script.  tongue

Instead I tried for button 1:

on(release){
stopAllSounds();
}

but this makes it so you have to have the mouse pressed over the button the whole time for it to complete the audio ? if you take your finger off the mouse it stops playing, which is not what I want.  rolleyes

I want to be able to trigger sounds by just clicking once (as I already can without the above scripts added) BUT also have the audio play all the way through until I trigger another button, which would cancel out the first.

I?m sure it?s something simple I?ve overlooked ? I?m not savvy at all with action scripts. Any help would be much appreciated. Thank you in advance.

PS: Is the Hybrid 5 the same as the Jackulator9000? If not, is the Hybrid 5 available to newbies such as me? I?m thinking of learning how to make a massive pop-up board with Flash MX 2004 (inspired by the Hybrid 5 vid on youtube), but just wondered if the Hybrid 5 makes the process easier? Thanks again.  cool
Logged
Sir? what do ya think?
Perpetual Second Banana
Jack Mod
Team Jackulator
*****
Offline Offline

Location: "inside the meatsauce, drawing on my crap, like a drunk child"
Posts: 1604



WWW Awards
« Reply #1 on: January 03, 2010, 02:12:08 pm »

Maybe this will be of some help to you.

After Stopallsounds:

in the topic 'one way to make a soundboard button', you import mp3s into the library of your fla file and then drag the mp3s into the 'Down' frame of your buttons so that when you click them the mp3 plays

you can achieve the same effect with a combination of actionscript code on the button and then placing the mp3 file you want to play with a button in the same folder (called the _root folder) as the soundboard file (.swf extension)

so make the button the way you normally would by converting text into a 'Button', but instead of double-clicking the button and dragging the library mp3 into the 'Down' frame of the button, don't double-click the button, just make sure it's selected and then open the Actions window by clicking Window>Actions - and then type or paste in the following code exactly as it appears:

on (press) {
   mySound = new Sound();
   mySound.loadSound("TheExactNameOfYourMP3.mp3", true);
}

except replace "TheExactNameOfYourMP3" with the exact name of your mp3

when you publish your soundboard file, make sure the mp3 is in the same folder as the soundboard file and when you run the soundboard file and click the button it will play the mp3 - without having to have it in the library! cool

one thing though - this technique is extremely handy when making MEGABOARDS - because if you use the old method of having mp3s in the 'Down' frame of all of your buttons, when you've got a megaboard, that's a shitload of buttons with mp3s in them - the FLA file you work with will get increasingly sluggish as you get up into the hundreds of buttons - and eventually it will take entire MINUTES to load your FLA file to do more work on your board

making your buttons this way means that if you want to fix an mp3 file, you don't have to open your FLA file and import the fixed mp3 into the library or drag it into the 'Down' frame of the corresponding button - you just open up the mp3 with your sound editing software, fix it, then save it back into the _root folder

BUT THE DOWNSIDE OF MAKING BUTTONS THIS WAY IS:

if you want to load your soundboards up on the Internet, your boards will load extremely fast because they're basically just lines of code - no mp3 files - BUT - when people push buttons on your board, their browser has to download the file to their cache before it will play - once they click a button and their browser downloads the corresponding mp3, from then on when they click the same button it will load instantaneously, but for any button they haven't yet clicked, there is a lag time from the time they click the button and when the mp3 is played, depending on how big the mp3 is

so this is something you'll want to consider before you make a board comprised entirely of these new coded-style buttons and you plan to upload your board to the Internet

you could always provide a downloadable WinRAR or Zip file of your board and all the mp3s that go with it so people can run it on their own hard drives to fix this problem

or you could also use code to preload every single mp3 on the board and then build a 'preloader' for your soundboard - so people could wait while all the mp3s load, but that's another tutorial

Also, the h5 is not available to everyone at the moment, but i believe that you can use the hybridIV which is under the 'autoboards by jackulator' forum
Logged

http://www.youtube.com/hildegain
http://www.facebook.com/profile.php?id=1481771959&ref=profile
http://steamcommunity.com/groups/JackulatorT

Podcast


^^^^my crispin freeman sample^^^^
87+ calls posted, to be honest i cannot be bothered counting
Shhhhh
MISSING IN ACTION
baby jack
*
Offline Offline

Posts: 3


Awards
« Reply #2 on: January 03, 2010, 03:01:55 pm »

Thank you so much, Sir - that's done the trick, and from reading the instructions it seems this is a better way to create buttons too!  cool

Thanks for answering the Hybrid question, I'll have a look at version IV but for now I'm sticking with Flash MX 2004 because I'm having fun learning. I was looking at the Richard Dreyfuss soundboard and that has the type of layout and pop-ups I was thinking of incorporating into mine to make a megaboard. I'll go and try to follow the pop-up instructions here on Jackulator.com, the instructions you just posted were very nice and easy to follow. Thanks again!  cheesy
Logged
Sir? what do ya think?
Perpetual Second Banana
Jack Mod
Team Jackulator
*****
Offline Offline

Location: "inside the meatsauce, drawing on my crap, like a drunk child"
Posts: 1604



WWW Awards
« Reply #3 on: January 04, 2010, 06:17:03 pm »

haha thank jackulator for the instructions, i just figured it could work for ya smiley
Glad you're getting somewhere with your projects, i'll actually be uploading a side project of my own in a week or so because i've been so inactive lol.
Logged

http://www.youtube.com/hildegain
http://www.facebook.com/profile.php?id=1481771959&ref=profile
http://steamcommunity.com/groups/JackulatorT

Podcast


^^^^my crispin freeman sample^^^^
87+ calls posted, to be honest i cannot be bothered counting
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  



Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.046 seconds with 20 queries.