ActionScript 3.0 :: Make A Button To Play A Sound?

Sep 4, 2008

I've been trying to make a button to play a sound, I've created the button and have a sound in the library, but can't manage to get the button to play the sound!!! I get this error: 1120: Access of undefined property knock_sound.

I think I need to give the sound an instance name but it says I need to use AC2 to do that!!

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Make A Button Play Sound?

Mar 26, 2011

I have been working on flash in school, and the school upgraded from flash MX to flash CS5, i have then gone to make my project in AS3, however, it is very diffrent from AS2

My problem, is, all i want is a button to play a song from the libray (not from a URL on the internet like the code snippet) and my ICT teachers have no idea how to use AS3. I also need is a play, stop and pause button, and a volume control slider, i CAN do all these on AS2, i infact have it set up (but without a pause button) but, i cannot do this in AS3 and i need it done bady.

View 4 Replies

ActionScript 2.0 :: How To Make Button To Play Specific Sound

Jun 22, 2004

I have a button that is actually a Movie Clip (so I can animate it). I want this button to play a sound. (But this isn't a sound question.) If I have a list of 20 sounds, and 20 instances of this button mc, how can I make it know which sound is being called for? If it were a normal button, each instance would have its own load- or attach-movie command. But since they're MC's, the invisible button hit is always the same. Is there a way to make it look to the MC's instance name to get which sound to load?

View 14 Replies

ActionScript 2.0 :: Play Sound/stop Sound Button?

Feb 13, 2007

i want to make a single button to play a sound, and if pressed again, stop the sound. and if pressed again, play the sound, and so on...
i know it has to be made with a boolean variable, true/false, but i just can't figure out how.

View 13 Replies

ActionScript 1/2 :: Make Button On Rollover Starts Sound And Rolloff Stops Sound?

Jul 28, 2009

I have several buttons in a movie and I want to be able to rollover an individual button and play the sound for that button and when I rolloff I want the sound for that button to stop.

View 6 Replies

Professional :: When Press On The Button The Stars Will Be Flying From The Button And The Sound Will Play?

Jan 29, 2011

i'm designing a website in flash8... now i have created some buttons, and i want that when i click on the button stars will fly from them and there will be a sound... i have already created the animation of the stars seperatly and it's in the library, i have also the sound file.... i just can't remember how to put everything together.... when i'll press on the button the stars will be flying from the button and the sound will play?

View 3 Replies

Make Sound Effect Play On Collision?

Jun 3, 2010

Im an aspiring flash game developer struggling with a bit of code in my upcoming game, I want to play a sound(A "ding") everytime the main character touches a cookie on stage. The main character follows the mouse cursor, and the cookies fall down from the sky.

I have scripted the cookies main class, with this function(which works fine)
private function eFrame(e:Event):void{

Code:
private function eFrame(e:Event):void{
this.y += 3;//move the bell slowly downwards
if(this.hitTestObject(_root.mcMain)){//if this touches the main character
_root.mainJumping = true;//make him jump

[Code].....

And I was hoping it would go into the library and play the sound bit named "bellSound" but it doesnt do this, instead nothing happends, not even any errors under the "Compiler errors" So no im a bit lost, as I do not know how to make this work, so a sound is played when the main character touches the cookie.

View 3 Replies

ActionScript 3.0 :: Make Sound Play On Click?

Jul 12, 2010

The sound only plays when I hold the mouse button down. I need  it to play when I click it. But it has to stop the sound from  playing twice import flash.media.SoundMixer; this.addEventListener(MouseEvent.MOUSE_UP,f); function f(e:Event):void{ SoundMixer.stopAll(); } here is a link to my swf file [URL]

View 4 Replies

ActionScript 3.0 :: Make Sound Not Play When Swf Loads?

Nov 8, 2011

I have a sound in the library named RolloverSound and a MovieClip on the stage with instance name of btn. I hear this sound whenever I rollover btn and that's all I want it to do. The problem is is that it also sounds off when the swf loads and I don't want that.

[Code]...

View 6 Replies

ActionScript 3.0 :: Make The Sound Play First And Then Stop It?

Feb 10, 2011

make the sound play first and then stop it?

var music:Sound;
var trans:SoundTransform;
var channel:SoundChannel;
var musicOn:Boolean = true;

[code]...

View 0 Replies

Professional :: How To Make Sound File Play In Only One Scene

Mar 13, 2011

I have a flash file with about 20 different scenes in it. And in one of the scenes there is an audio file that is 15 seconds long. The sound is on a menu page so i only want it in that scene. But if you are on that page for less than 15 seconds and go to another page then it carries on the sound into the next scene and if you go to and from the menu page to another scenes in quick succession you get a build up of sound which is horrible.

View 1 Replies

Actionscript 3 :: Make Sound Only Play Once When Objects Touch?

Feb 25, 2011

I have a griddle_mc, bacon_mc, and BaconCooking.wav. I want to play the wav when the bacon is moved onto the griddle. If I move the bacon until it just touches the griddle the wav plays fine, but if I continue to drag the bacon_mc across the griddle the wav becomes loud and distorted, almost like it's playing multiple instances of the wav at the same time.

private function __handleSliceDown($evt:MouseEvent):void {
slice1_mc.startDrag(true);
}

[code].....

View 2 Replies

Play A Sound On Button Press?

Aug 11, 2009

OK, say I have a button that does something, like go to the next frame, is there anyway to have it play a simple sound located in the library without looping?

View 8 Replies

ActionScript 3.0 :: Button Sound Wont Play?

Jun 13, 2010

after importing the sound to the library, and naming the class sound1, here is the code used
its a simple code, and theoretically should work - but for some reason, its not registering the sound as being played.....

View 7 Replies

ActionScript 3.0 :: Play / Stop Sound On One Button?

Jan 27, 2011

When you click the first time on the button, it should start the song, when you click a second time on the button, it should stop the song. how do i make this with actionscript 3?

View 1 Replies

ActionScript 3.0 :: How To Play Sound On Button Down State

Mar 30, 2011

How do I play a sound on CLICK or the button's down state? I know how to slap a sound on the timeline but not how to put it specifically to the button and it's down state.

View 3 Replies

ActionScript 2.0 :: Pause And Play Sound Button?

Dec 24, 2011

How to add both pause and play sound button in a single button.. on play it shows the image pause and on pause it shows the image play.

View 4 Replies

ActionScript 3.0 :: Play Sound On Click Of A Button?

Sep 11, 2006

I want to play a sound on click of a button. I can do this in AS 2.0

//Action Script 2.0

Code:

snd=new Sound();
snd.attachSound("try");
snd.start();

[Code].....

View 11 Replies

IDE :: Sound On/Off Button; Loop; Auto-play?

Jun 23, 2008

I'm almost done building a full flash site where it navigates by position of timeline.I just need a simple on/off button for a soundloop to loop and play automatically. the on/off button just simply turns it off (toggle is optional). on it doesn't have to resume, just start the pool again.

View 14 Replies

ActionScript 3.0 :: Play More Than Sound When Click Button?

Apr 17, 2011

i want to gotoAndPlay more than one sound Ex: when i click the button i want to play frame label m2 and frame labe m1 sound

playy.addEventListener(MouseEvent.CLICK ,pl);
function pl(event:MouseEvent):void
{
so.gotoAndPlay("m2");
so.gotoAndPlay("m1");
}

the sound play in the same time i want to finsh play frame label m2 then stop then play frame labe m1 and stop.

View 3 Replies

ActionScript 2.0 :: [Flash8] Getting Sound To Play When Keyboard Button Is Hit?

Dec 9, 2009

I think worded the question wrong or posted in the wrong catagory I keep geting error messages with this code in AS2.0

Code:
if (key.isDown(key.getCode(81))) {
_root.samplesound=new Sound();
_root.samplesound.attachSound("sample1")

[code]....

This is the message fore both pieces Statement must appear within on/onClipEvent handler Im trying to get the letter "q" to play a linked mp3 in my library When I apply the code to a seperate layer No error messages shows, but no sound plays. When I apply the code to a movie clip/button object, that message shows up!

View 2 Replies

Flash Piano - How To Get Each Instance Of Button To Play Unique Sound

Jun 15, 2009

I'm using flash CS4. I am trying to make a piano. It will be the header of a web page when the mouse rolls over a key the appropriate note plays- ideally the key would appear to be pressed as well. I have a jpg of a piano keyboard imported as a graphic. On a new layer I have made a button whos over state has a blank keyframe. I have imported that button to the stage and given the instance a name. I have attached a sound to the over keyframe (middle C).

I have dropped a second instance of the button onto the stage and given it a unique name. When I attach the next sound (D pitch) to the over state it changes the original middle C. How can I get each instance of a button to play a unique sound? I have tried using a new layer for each button but that didnt work. Do I have to make a brand new button for each note? I have reduced my design to include only 16 notes (I originally wanted 32 but I thought that may take too long to download)---

View 7 Replies

Actionscript 3 :: Flash Play/Pause Sound Toggle Button?

Sep 11, 2010

I've googled and googled but got no where or outdated tutorials. Anyone know how to make it so I can toggle audio with buttons using ActionScript 3 on Flash?

View 2 Replies

ActionScript 3.0 :: Button That Play Sound When Clicked And Be Controlled With Events?

Nov 8, 2011

I'm a flash beginner and I've been having alot of trouble figuring out how to make a button which can be controlled with the keyboard as well as the mouse and plays a sound when clicked but when the button is released the sound instantly stops. What I'm going for is a piano application, I made the button, I know how to create keyboard events with listeners and make the different button states up and down but I don't know how to control the button with the keyboard and play sound when the button is clicked but stop the sound when the button is released.

Also I'd like to have it where the space bar will cancel whatever makes the sound stop so it just rings out until the sound clip ends. Can someone explain to me how to do this, remember I'm a beginner so please explain everything.

View 6 Replies

ActionScript 3.0 :: Create A Button That When Press It And Hold It Play A Sound?

Feb 15, 2010

Is it possible to create a button that when you press it and hold it, it will play a sound, and when you release it then stops the sound?

View 2 Replies

ActionScript 3.0 :: Controlling Sound File With Play Stop And Mute Button

Oct 6, 2010

the method for stopping/playing sound in 2.0 don't work for 3.0. i can stop the sound by going to a different page/frame on the site.but i want the buttons.

1. play button?

2.stop button?

3.mute button?

View 1 Replies

ActionScript 2.0 :: Volumeslider - Sound To Start Directly When Press The Play Button

Apr 21, 2005

Look at this tutorial [URL] I want the sound to start directly when you press the play button, without having to adjust the volume.

View 14 Replies

ActionScript 2.0 :: Sound Attachment - Click On The Objects First Before Clicking On The Play Button

Sep 21, 2006

I have been trying to deal with sound attachment. Attached is the source file that i am dealing with(I deleted the sound files because the size is too big): Simply, i have to click on the objects first before clicking on the play button. Each objects i clicked represents a different sound and will be stored in the array. So i will be clicking the objects in sequence and when i click on the play button, the music will play. Now comes the problem with my coding, I was unable to let my music coming out one by one at the time in sequence.

View 10 Replies

ActionScript 2.0 :: Make An On / Off Sound Button?

Apr 18, 2011

So i want the sound button to be both the same on and off like [code]...

So i want to know WHAT as2 code can i make to make it so out of the on &off button can be the SAME button on the SAME button can have the SAME on button SAME off button when you click the same thing.

View 2 Replies

ActionScript 3.0 :: Make A Button Turn On/off A Sound When Pressed?

Jan 29, 2009

I am trying to make a button turn on/off a sound when pressed. I have tried to code it, but it does nothing everytime.

I have a sound in the library, with a linkage name of "sound" it is on the first frame in the main timeline. And i need a button to turn it off, and then on again.

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved