sound help AS3
Hey people,
I'm a guy more old as2, switch to full as3. Now, I want to do everything I can in as3. My final hurdle is healthy. I can get sound to play, but I can't add a delay to the sound. So, when I picked up the item to drag, it lifts and I delay using a Tween Oregon to make it appear more life like. I would like to delay the sound piece for the duration of the item down. I have attached the section of the code. Any ideas would be great. I know that I could add sound space for the mp3 itself but as part of my project that would be crazy.
var I: Object;
function grabMe(e:MouseEvent):void {}
= me e.currentTarget;
me.removeEventListener (MouseEvent.MOUSE_DOWN, grabMe);
me.startDrag ();
e.target.parent.addChild (e.target)
var tweeny:Tween = new Tween (me, "y", Regular.easeIn, me.y, me there - 75,.04, true);
var scaley: Tween = new Tween (me, "scaleY", Regular.easeIn, me.scaleY, 1.3,.09, true);
var scalex:Tween = new Tween (me, "scaleX", Regular.easeIn, me.scaleX, 1.3,.09, true);
var my_shadow:DropShadowFilter = new DropShadowFilter();
my_shadow.color = 0x000000;
my_shadow.blurY = 3;
my_shadow.blurX = 3;
my_shadow.angle = 90;
my_shadow.alpha =. 2;
my_shadow.quality = 15;
my_shadow.distance = 75;
var filtersArray:Array = new Array (my_shadow);
me.filters = filtersArray;
stage.addEventListener (MouseEvent.MOUSE_MOVE, Drachma);
stage.addEventListener (MouseEvent.MOUSE_UP, dropMe);
}
function dropMe(e:MouseEvent):void {}
stage.removeEventListener (MouseEvent.MOUSE_UP, dropMe);
stage.removeEventListener (MouseEvent.MOUSE_MOVE, Drachma);
me.stopDrag ();
me .filters = undefined;
var tweenydown:Tween = new Tween (me, "y", Regular.easeIn, me.y, me there + 90,.4, true);
var scaley: Tween = new Tween (me, "scaleY", Regular.easeOut, me.scaleY, 1,.9, true);
var scalex:Tween = new Tween (me, "scaleX", Regular.easeOut, me.scaleX, 1,.9, true);
me.addEventListener (MouseEvent.MOUSE_DOWN, grabMe);
my_channel = my_sound.play)
}
function dragMe(e:MouseEvent):void {}
e.updateAfterEvent ();
Using TweenLite or Max, you just make your tween and add an onComplete parameter as follows:
TweenMax.to (me, 2, {onComplete, scaleX:2:playSound});})
This will tween me is scaleX for more than 2 seconds and call the playSound function when it ends...
Tags: Adobe Animate
Similar Questions
-
I heard that stop sound in AS3 to write specific code. I don't know what this code is, then, if anyone of you knows it please tell me because I would like to be able to stop a song in a game on the following image. (For example, frame 2)
This depends somewhat on your configuration, but in general you play a sound in a sound channel object... and you can tell channel.stop (); to stop the sound. Or you can use the SoundMixer object to stop all sounds in the film. Take a look using the SoundChannel and Sound, they have good examples.
-
Stop all sounds in as3? Help
When the game starts. I have the toggle button. I can play a sound or stop the sound. When I play the sound, of course it is not cut so even if I go to the next page. I can reason that the sounds will play always.
But if I press the no sound, so it means it must be cut... on the first screen, the sound stops. But when I next executives and others. The sounds are playing. The sound on the screen
looked like
var test: Sound = new NameOfSound();
but in the next... the sound is in the framework itself... no declarant as the first screen...
and also some sounds play when something happens or for example if the ball hits the target collsion... good reading...
I tried to have the solution as in the first screen if for example she is silent... I'll set it to trueStop... then on the following frameworks... I would put:
if(trueStop == true) {}
SoundMixer.stopAll ();
}
in this way the framework seems stopped and functional... but sounds to join the service when as I said if a collision occurs, the sound plays again... arrgghh I can not explain clearly... I hope you understand my problem...
any ideas?
If you need to stop the individual sounds, assign a soundchannel for instance returned by your method of reading and apply a method to stop this soundchannel.
for example:
var s1:Sound = new S1();
var sc1:SoundChannel=s1.play();
now, anytime you can use:
SC1. Stop(); to stop the s1 only.
-
In AS2, you can listen to sound through s.loadSound("mysound.mp3",true) where the second loadSound parameter indicates that you want the sound.
How do you do this in AS3?
Thanks for your help.
KenWhen you run your load(), the audio file begins to download. who will continue unless you run a close() method.
your sound will start playing when you run, you're your play() method or after the bufferTime is met, the first of the two prevailing.
the real question is how do you keep streaming in as3. and who is easy to aid sound complete event to trigger the play() method. If the play() method is executed while loading is complete AND bufferTime is lower than the charging time, your sound will flow.
-
Windows XP no sound help,
I have windows xp and no sound, when I checked in Control Panel "sounds and devices or audio", he said that it was working properly, but whenever I play video or music is not there no sound coming. I install and download a lot of things, but will not work.
Please help meI have windows xp and no sound, when I checked in Control Panel "sounds and devices or audio", he said that it was working properly, but whenever I play video or music is not there no sound coming. I install and download a lot of things, but will not work.
Please help me====================================
The following links may be worth a visit:No sound in Windows
http://Windows.Microsoft.com/en-us/Windows/help/no-sound-in-Windows
(Win XP / Vista / 7)(307918) how to troubleshoot sound problems in Windows XP
http://support.Microsoft.com/kb/307918/en-GB -
I have windows xp d310 and no sound help
no help sound dell a310 and that they want to work with me to resolve the problem.
The following article might be worth a visit:
Windows 7 - no sound in Windows
http://Windows.Microsoft.com/en-us/Windows/help/no-sound-in-Windows
(valid for XP - Vista - 7) -
Windows media CTR. No sound, but the rest of the programs have sound - help
I can listen to music through WMP, listen & play YouTube videos on the internet with sound. the only time where the sound does not work is when I use windows media center?
Hello
1 are there any changes or updates made on the computer?
2. the problem occurs for all video and sound clips in windows media center?
I suggest you to return the item and check if it helps.
Audio problems in Windows Media Center
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-audio-problems-in-Windows-Media-Center
See also:
When you use Windows Media Center to play live TV or a DVD on a Windows Vista-based computer, you do not hear sound after you wake the computer from sleep mode
http://support.Microsoft.com/kb/942364
Let us know if it helps.
-
No sound help please - driver is not compatible with my version of windows
Original title: no noise don't please help
While UN-installing some I have programs no longer use i accidentally uninstalled my driver audio soundmax. I have a dell optiplex gx520 with the 32-bit version of windows 7 Home premium. I tried to find and re - install the driver sound max and I find one and download each time it says that the driver is not compatible with my version of windows. I would really like my back her again. also, I went into the start menu and click on the sound devices and game controllers, and all that shows is my webcam. I know that I have an internal sound card and a speaker and I know that they do not work, but when I searched for the pilot, he was gone and so I know that it is uninstalled by me when I remove other programs, I no longer use. any help you could give me would be greatly appreciated. Thank you.
Hi Bill,
See the link to install the drivers for the Dell OptiPlex GX520. The drivers are not available for the Windows 7 operating system. Therefore, I suggest you to install in compatibility mode and check if it works:
Make older programs in this version of Windows
http://Windows.Microsoft.com/en-us/Windows7/make-older-programs-run-in-this-version-of-Windows
Let us know the results.
-
Video appearing as a sound, help
When I download my video clips, they appear as a "audio" and just sound and no video clip
Please help, I am new on this
When you download to? YouTube, Vimeo, somewhere else? The files play fine on the computer before you download?
-
Addition with sound help please
additional assistance with the sound.
I have a noise in the way of step 1 that I want to play as soon as the movie starts. the user is able to control by pressing the pause key
pPaused property
on beginSprite me
pPaused = 0
end
on mouseUp me
If pPaused then sound (1) .play)
of another sound (1) .pause)
pPaused = not pPaused
end
I have other sounds in songs (2 sounds) and nursery rhymes (4 sound) with the behavior added to the buttons below etc..
on mouseDown me
Sound (5) .play (member ("ABCSong"))
end
on endSprite me
Sound (5). Stop()
end
This stops the sound when I get out of the framework, but does not stop the noise in the channel from step 1.
I don't want to play 1 sound a perferly of time when the button is pressed and stop
could someone please indicate how to solve this problem. only using lingo of basic/intermediate I need to understand.
any help is very appreciated
Thank you
Try:
on mouseDown me
Sound (1) .pause)
Sound (5) .play (member ("ABCSong"))
end
on endSprite me
Sound (1). Play()
Sound (5). Stop()
end
-
Learning helps AS3 - first example
I am new to AS3 and strting to learn it.
At the outset, I want to control a clip (play, pause) using two buttons.
Then, I placed a movie clip (square) and two buttons (btnPlay, btnPause) on the scene.
and created Engine.as assigned to the stadium.
Engine.As.
package {}
import flash.display.Stage;
import flash.display.MovieClip;
public class engine extends the scene {}
private var State: Boolean; store the weather plays the clip or not.xc
public void Engine() {}
the constructor code
square private var: MovieClip;
private var btnPlay:Button;
private var btnPause:Button;
private void mcControlPlay(evt:MouseEvent):void {}
Square.Play ();
trace ("mcControlPlay");
}
private void mcControlPause(evt:MouseEvent):void {}
Square.Stop ();
trace ("mcControlPause");
}
square = new MovieClip();
stage.addChild (square);
btnPlay = new Button();
stage.addChild (btnPlay);
btnPlay.addEventListener (MouseEvent.CLICK, mcControlPlay);
btnPause = new Button();
stage.addChild (btnPause);
btnPause.addEventListener (MouseEvent.CLICK, mcControlPause);
}
}
}
Please help me solve this problem
files downloaded
http://www.learningashram.com/sites/default/files/Test1.zip
If you comment the variables (square, btnPlay, btnPause) that you want to comment on most of the other references in the code as well. Example you don't need all this:
var square: MovieClip = new MovieClip();
addChild (square);
var btnPlay:Button = new Button();
addChild (btnPlay);
btnPlay.x = 100;
btnPlay.label = "Play";
var btnPause:Button = new Button();
addChild (btnPause);
btnPause.x = 400;
btnPause.label = "Pause";
since they are already made and on stage... you want to add the headphones from the mouse, so that they are doing something again.
-
I'm still learning AS3, and I was woking with sounds. This was to be used to stop the cound assigned to the var channel 1 when I click on the button, the sound is muffeled just, but can't stop playing. Anyone knows there is a problem with flash running in Windows Vista?
Here is the code:
Stop function
function stopClick(evt:Event):void {}
CHANNEL1. Stop();
}
bStop.addEventListener (MouseEvent.CLICK, stopClick);
Thank you
I thought about it. When I added the soundLoaded function, I thought that I deleted the. play() and the head of my code. Now it looks like this, and it works.
Creates a var musicURL and assigns it the name of location of background music.MP3
var musicURL:URLRequest = new URLRequest ("background music.MP3");
Creates a sndMusic var and pointing to the location of musicURL
var sndMusic:Sound = new Sound (musicURL);
Creates a SoundChannel var
var channel1:SoundChannel;
Play the sndMusic and assigns the soundChannel for channel 1function errorMsg(evt:IOErrorEvent):void {}
trace ("the sound could not be loaded");
}
sndMusic.addEventListener (IOErrorEvent.IO_ERROR, errorMsg);function soundLoaded(evt:Event):void {}
trace ("Sound Complete");
Play the sndMusic and assigns the soundChannel for channel 1
CHANNEL1 = sndMusic.Play ();
}
sndMusic.addEventListener (Event.COMPLETE, soundLoaded);Stop function
function stopClick(evt:Event):void {}
CHANNEL1. Stop();
}
bStop.addEventListener (MouseEvent.CLICK, stopClick);Start function
function playMusicClick(evt:Event):void {}
CHANNEL1. Stop();
CHANNEL1 = sndMusic.Play ();
}
bPlayMusic.addEventListener (MouseEvent.CLICK, playMusicClick);Thank you. I hope this will be useful for anyone else making the same mistake I did.
-
Discoloration Flash movies and sound-HELP NEEDED
Hey guys I need help
first of all if you want to help me could u please visit this site
http://www.thetimemovie.com/
This site is what I want to do
Note pictures of discoloration which can be controlled and the sound bar at the bottom left
Any help would be GREATLY frequented b
Thanks in advance
BUTCH101
PS: email [email protected] if you have any info thanksWhat I see in the test site is that the "sound bars" are not sync was at all. They are just a looped clip which stops in diagonal form when you click it. And the sound is not really be stopped, when you click on the bars. Rather, the ActionScript is actually turn the volume down, little by little. The sound plays always continuously, you just can't hear it. This is evident in the fact that when you restart the sound, he not pick up where you left it, but at the point where it would have been anyway, had you not clicked the button.
I think that the sound is set to streaming and can thus be processed image by image. So, your quest is to have someone (more knowledgeable than me) provide examples of code that would begin to reduce the volume of the sound increments object as the film passes through the images. Something like:
{onFrame (95)
mySound.setVolume (80);
}
{onFrame (110)
mySound.setVolume (60);
}
{onFrame (120)
mySound.setVolume (40);
}
{onFrame (130)
mySound.setVolume (20);
}
{onFrame (140)
mySound.setVolume (10);
}
{onFrame (150)
mySound.setVolume (0);
}Obviously, you would use numbers of images, but a variable that represents the current frame compared to the plot of the film was on when you clicked the button.
-
I need to make a sound play when I press a key. any help would be good. I'm using the mouse click buttons to trigger sounds.
Make an interactive drum set.
file .fla HEREPress a key or press a button? Aid has lots of good info, FWIW.
Here is a small sample of play a sound library if you press the button "a":
var mySound = new Sound();
var myListener:Object = new Object();myListener.onKeyDown = function () {}
var k = Key.getAscii ();
If (k == 65 | k == 97) {}
mySound.attachSound ("Sunda");
mySound.start ();
}
}Key.addListener (myListener);
--
Dave-
www.offroadfire.com
Developer leader
http://www.blurredistinction.com
Adobe Community Expert
http://www.Adobe.com/communities/experts/ -
PC - TV sound help... URGENT
Hi guys, set up my PC on my new Sony TV today, via the blue cable (the one that you connect the PC to a monitor), and when I tried to watch community earlier, there is no sound
EDIT: I think that the cable is RGB or something
So, how can I get my TV to play the sound from my PC via this cable?
Thank you
Hi guys, set up my PC on my new Sony TV today, via the blue cable (the one that you connect the PC to a monitor), and when I tried to watch community earlier, there is no sound
EDIT: I think that the cable is RGB or something
So, how can I get my TV to play the sound from my PC via this cable?
Thank you
=======================================
Perhaps the following links will propose a few ideas:How to connect my computer to a TV
http://hookpctotv.com/How to connect your PC to your TV
http://en.kioskea.NET/FAQ/Sujet-228-how-to-connect-your-PC-to-your-TV-setPC to TV cables and adapters
http://www.SVIDEO.com/PC2TV.html
Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.
Maybe you are looking for
-
Can not set the print properties
Just loaded FireFox 4.0.1When I click onfileprintand the print window opens if I clickProperties to define the quality or black etc. only I getan error box that says:ErrorProp Res DLL not loaded I tried exactly the same thing using Windows internet e
-
My X 60 a double boot Windows XP and Linux Mint 15. I need high grade at 17 Linux Mint. (and debris at the time wanted the Win XP partition as I no longer user there) But when I try to boot from a CD or a USB drive the .iso image file does not launch
-
"Could access the network location:.."
I get the "could access the network location:. «error with installing and uninstalling of programs, i.e. iTunes, Quicktime.»»I checked the Internet and found registry patches, but they have not worked for me. I tried the Fix It program in one of the
-
Windows Installer again, the number of COA is unreadable!
The hard drive on my HP Pavillion Dv5 failed recently, so I had to buy a new one and I then reinstalled Vista using a friends installation disc, however I am unable to read the number of the COA label on the back of my laptop because it is totally un
-
Hey! I wouldn't exactly say this a material issue, but today I experimented a little with my machine. All the equipment had been disconnected and reset even if it was dumb of me to no brand son connect to the place where I believebthat is my problem.