ActionScript 2.0 :: Play A Sound Using "attachSound" And "start" With A "hitTest"?

Jul 24, 2006

What im trying to do is play a sound using "attachSound" and "start" with a "hitTest". I've exhausted everything i can think of and it still doesn't work.

View 2 Replies


Similar Posts:


ActionScript 2.0 :: Play A Sound On HitTest?

Jul 11, 2009

ActionScript Code:
onClipEvent(enterFrame){
if(this.hitTest(_root.player)){
_root.coinsnd.play;
}
}

When the player touches the movie clip this sound will play, no errors found on this script but it doesn't work

View 3 Replies

ActionScript 1/2 :: Play A Sound Once If HitTest Is True?

Dec 31, 2010

I have 2 movieclips with instance names: bonus and platform. (and a movieclip inside platform with instance name: hit) I need a sound to play when hitTest is true.
Here is non-working code:

[Code]...

I dont see why this doesnt work. The sound is in the library with linkage name: snd50Points The trace("hit"); doesnt give an output when they do collide. I have a seperate hitTest that does give an output however, could this mean I cant have a hitTest of the same thing at once? I cant delete the onEnterFrame loops of the other hitTest because it has code that needs repeating. So yeah, I need a sound to play once when they collide and play the sound once again when they collide and so on.

View 5 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 :: Use AttachSound Method To Load 2 Or More Sounds To Play At The Same Time?

Feb 23, 2005

Can I use attachSound method to load 2 or more sounds to play at the same time? If yes, how?

View 2 Replies

ActionScript 2.0 :: AttachSound MC "speaker" Is Two Levels Deep In A Fla And Will Not Play?

Jul 24, 2009

The following AS2 code is placed inside MC "speaker":

ActionScript Code:
var homeSound:Sound = new Sound(this);
    homeSound.attachSound("page1Sound");[code]....

The MC "speaker" is two levels deep (inside an MC, which is inside an MC) in a fla and will not play. However, when I copy the MC "speaker" (and associated sound file) to a new fla it plays fine.

View 3 Replies

Actionscript 3 :: HTML: Start Sound Playback From URL Mid-file Without Buffering All Sound Data To That Point?

Nov 21, 2010

I have a long mp3 file hosted on a standard apache server (30 minutes long so far, but I would like it to work with longer sounds too).I'd like to start playback of this audio within at a specified point. When attempting to use Flash Actionscript 3, my basic tests show that ALL the audio from the start to the position I choose is buffered before playback (Sound.bytesLoaded was my friend here). If I start one second in, it takes about 3 seconds to start playback, 30 seconds in, takes about 25 secondsObviously with a really long mp3, like skipping playback to the middle of a 3-hour audiobook, this isn't going to be practical.Here's the ActionScript 3.0 code I'm using:

button.addEventListener(MouseEvent.MOUSE_DOWN, function():void {
var s:Sound = new Sound();
var req:URLRequest = new URLRequest("http://example.com/audio.mp3");

[code].....

View 1 Replies

ActionScript 2.0 :: Random Sound Load And Start Is Speeding Up The Sound?

Dec 16, 2005

I'm trying to load sound dynamically into a clip and then play it randomly. The AS I came up with works great if the sound is embedded and I use the .attachSound() method instead of loadSound(). Now, when I load it dynamically and use the code below, the sound plays very fast and at a higher pitch.

Code:
var crows = new Sound(this);
crows.loadSound("Raven.mp3", false);
crows.setVolume(100);

[Code].....

View 1 Replies

HitTest Was Playing The Sound Over And Over?

May 20, 2009

I have a playhead that moves across the screen and when it hitTests a movie clip it plays a sound. all is working fine except that it will only work the first time it is played. The playhead is controlled by a button. I am working in Actionscrpt2. Here is the code on the movieclip:

onClipEvent(enterFrame)[code]....

In the begining I was having trouble because the hitTest was playing the sound over and over but the above code sorted that out. I think that the new problem was created by fixing the old one.

View 7 Replies

Media Server :: Stream.play (live_from_FMLE, -1, 4500, True) Got No NetStream.Play.Start?

Nov 5, 2010

I got a bunch of live stream from FMLE, say: "FMLE_channel1", "FMLE_channel2", "FMLE_channel3". And then on the server side, I created several corresponding republished stream called "channel1", "channel2", "channel3".

On periodical basis, we call Stream.get("channel1").play("FMLE_channel1", -1, 10, true) every 10 seconds. Similar things were done on the second channel & third channel.Soon after the above Stream.get("channel1").play() call, I should get the following events in sequence:info :NetStream.Unpublish.Successinfo :NetStream.Publish.Startinfo :NetStream.Play.Resetinfo :NetStream.Play.Start In the above case all are happy. Clients can view channel1, channel2, channel3 well.But then after a while, one of the three channels, in most case it would be channel1, will not be viewable.

With the server trace info, I found that after the Stream.get("channel1").play() call, only the following two events exists:

info :NetStream.Unpublish.Successinfo :NetStream.Publish.Starti.e. I was missing the play.reset and play.start event.I further checked and confirmed that the FMLE was publishing all three channels fine to the server. I was able to view the "FMLE_channel1" from flash clients, but not the republished "channel1". the version is FMS 3.5.0.

View 3 Replies

ActionScript 3.0 :: Stop Sound On Hittest

Jun 30, 2011

when the game starts im playing a simple song, and when my character falls, the sound should stop playing.[code]if ( player_mc.fall_mc.visible && player_mc.fall_mc.currentFrame == player_mc.fall_mc.totalFrames )// here when player falls, it plays a falling sound, but the main song wont stop, and when i restart the level, the main song starts again over the current playing song.[code]

View 2 Replies

ActionScript 2.0 :: Playing A Sound On Hittest?

Feb 18, 2005

Okay so i'm making this game, and I want it, so when the bar scrolls across the screen and hits the box it will play the sound inside the box mc.The code I have inside the box with the sound is.

onClipEvent (enterFrame)
{
if (this.hittest(_root.trackline))

[code].....

View 4 Replies

ActionScript 2.0 :: HitTest To Trigger Sound?

Nov 27, 2005

I'm a flash newbie working on a "game" for an architecture grad school class, using 2004 MX and and a Flash 8 demo. The game is a player in a street scene, where the user moves the player around with the arrow keys, and the up and down keys also zoom in and out. That part is working okay. My other objective is that when the player collides with any of the bulding facades, text describing the building would pop up, and a sound would be played. This is where I'm having trouble. I'm having some success with using hitTest to keep the player contained within the buildings, but great difficulting trying to get sound to play or text to appear when the player collides with a building front.

I converted one of the building facades on the "obstacles" layer to a movie clip ("snare3_mc"), with export to actionscipt checked. I'm trying to reference this movie clip in the "actions:Frame 1" code to play a sound when the player collides with it, and I'm also doing a test to see if it works by having it trace some text. I can get the trace to work for the "obstacles" layer with the buildings, but not specifically for the "obstacles.snare3_mc" facade (the green one). If I change line 123 of the code from "obstacles.snare3_mc" to just "obstacles", the trace text works, but I hope to have it specifically address the green building, not all of the buildings. Somehow I must not be properly loading or properly referencing the green object, my "snare3_mc" movie clip. Any ideas?.

Beyond not being able to specifically address the "snare3_mc" in the code to get the hitTest to even work, I can't get my audio clip to play no matter what I try. I'm trying to make the player's collision with this movie clip trigger the "snare3.wav" sound, but to no avail. The part of the code where I'm attempting this is the same hitTest with the trace text, lines 123-128 of the "actions:Frame1" code. Again, I'm probabl-y improperly loading or improperly addressing the sound in code.

The one other thing I want to do is to try and make text pop-up in a hidden box when the player collides with the green facade ("snare3_mc"). Ideally this text would appear out of nowhere when the player is in collision with the green facade, but dissapear entirely when the player moves away from the facade. I haven't even tried this yet in my .fla, but would want it as part of the same hitTest referred to above, lines 123-128.

Attached are 2004 MX and Flash 8 .fla files of this rough, ugly test version of my game.as the semester is winding down and my professor is not so into Flash or games. I feel like I am close, but really need help with these three little issues: properly referencing movie clips in the code for the hitTest, making the hitTest play a sound in my library, and making the hitTest pop up a text box with text while the player is colliding with the building facade.

View 1 Replies

ActionScript 2.0 :: Playing A Sound On Hittest

Feb 18, 2005

Okay so i'm making this game, and I want it, so when the bar scrolls across the screen and hits the box it will play the sound inside the box mc.

The code I have inside the box with the sound is.

onClipEvent (enterFrame)
{
if (this.hittest(_root.trackline))
{

[Code]....

View 4 Replies

ActionScript 3.0 :: NetStream Choppy - Make A Character Start To Talk When The Sound Starts And Stop Talk When The Sound Stops

Aug 5, 2010

Need to make a character start to talk when the sound starts and stop talk when the sound stops so I'm using this:

[Code]...

View 2 Replies

ActionScript 2.0 :: Sound Plays Several Times During Hittest Instead Of Once

May 9, 2010

I posted a previous thread on this but i have found the problem but cant fix it!!

i have balls that can be thrown around the screen and when they touch i want them to play a specific sound to those balls.[code]...

View 0 Replies

Flash Won't Auto-start Flash Intro Will Only Start After Play (ctr+entr)

Jul 21, 2009

i have a flash clip that i am trying to imbed into a joomla website of mine, and the problem is that it doesn't auto-start. If i open the swf file it will show a blank screen until i right click play or ctr+entr, on the website it simply doesnt show the flash. here is the link to the swf file [URL]

View 1 Replies

ActionScript 3.0 :: Create Dynamic Sound To Play Sound-file?

Oct 14, 2009

It's possible to play a sound file through AS, either by loading it from a folder or import it to flash. It's also possible to play a dynamic tone with flash.media.Sound + writeFloat.

But... is it possible to play a sound file with flash.media.Sound + writeFloat in some way? I want to play a sound file without having to deal with any files except the .swf!

View 9 Replies

ActionScript 1/2 :: HitTest GoToAndPlay(2) - Play The Movie

Sep 26, 2010

when my character hits a certain object, I want it to play the movie. BUT since the hitTest is techincally always true if my character is just sitting on the object the entire time, it continuosly player frame #2. What is the simple fix for this? The code that will just play movie clip ONE TIME, and not restart continuosuly?

View 1 Replies

ActionScript 2.0 :: Hittest Random Goto And Play Help

Dec 31, 2010

I am trying to right a code that will help me make a random gotoAndPlay hits test script like you see the the popular game Pokemon. I have a character that is going over top of another movie clip but i want it to start generating random number and once it its a certain number i want it to go to the frame it is assigned to.[code]

View 2 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

AC2 :: Stop One Sound And Start Another?

Jun 17, 2009

I am creating an animation with very few controls for a presentation and it requires adding sound. I have my intro in the first frame with one sound and then want the user to click anywhere to start the animation and another sound.The problem I am having is sound control.No matter what I try the sounds overlap. I have managed to stop the first sound when going to the next frame - the animation, but the second sound now will not start. The first sound is called in from the library with the below code:

var snd = new Sound();
snd.attachSound("Tune");
and stopped when going on the next frame with:

[code].....

View 1 Replies

Start & Stop An Mp3 Sound

Jun 28, 2009

I wish to be able to play a voice sound every 3 minutes. I have the sound in "mp3' format and need to repeat the message every 3 minutes.

[Code]...

The actionscript 3.0 I wrote makes the sound once but that's it. I have the "Loop" on but it only runs once. I need a Timer also but until I can get the sound goes its a mute point.

View 26 Replies

AS3 :: Click Sound At The Start Of Recording?

Dec 15, 2011

I'm currently recording sound and storing the byte array for playback and subsequent encoding to mp3.

Unfortunately though I am getting a click sound at the very beginning of the recording.

I have attempted a couple of methods to try to eliminate this such as:

recording the first .3 seconds with mic.gain = 0; then setting mic.gain = 50; clearing the byteArray after the first .3 seconds then continuing to write the bytearray (in effect deleting the first .3 seconds of the recording.)

Neither of those methods has stopped the click being added.

how I can prevent the click from being added?

Here is my recording/storing code:

public var mic:Microphone = Microphone.getMicrophone();
public var micSilence:uint;
private var soundBytes:ByteArray = new ByteArray();
private var soundBA:ByteArray = new ByteArray();

[Code].....

View 1 Replies

ActionScript 2.0 :: Stop One Sound And Start Another?

Mar 5, 2010

I am trying to stop one specific mp3 file that plays throughout the whole document. But I don't want to use the off and on button. Instead when I press one of the pop-up buttons, I want a new sound to start in the pop-up window.

How do you stop the current sound that is playing and start the one on the pop-up? My main question is, is there a code that will stop current mp3, and start a different sound when the pop-up window is activated.

View 5 Replies

Actionscript 2.0 :: Start And Stop Sound?

Apr 13, 2009

How can I start and stop sound by using actionscript 2.0?

View 1 Replies

ActionScript 2.0 :: Start And Stop A Sound?

Dec 27, 2003

In this tutorial [URL] it shows how to start a sound, and I got that down, but using a seperate button, how do you stop the sound? I cant figure that out.

View 2 Replies

ActionScript 3.0 :: Want To Stop And Start A Sound?

Jul 8, 2009

PHP Code:
import flash.external.ExternalInterface;
snd = new Sound();

[code].....

View 1 Replies

ActionScript 2.0 :: Start Sound Immediately?

Sep 24, 2004

[URL].. i am following these tuts but evrything is working fine but what i want is that my music should start playing immediately as it is loaded rather then waiting to click button to play...

[Code]...

View 2 Replies

ActionScript 3.0 :: Get Flv File To Start Playing With No Sound?

May 2, 2009

I am trying to get my flv file to start playing when the page is loaded with no sound, but I am have no luck. The flv file starts playing fine with the sound on, and I can turn the sound off with my volume controller, but I need it to start playing with no sound.[code]...

View 3 Replies







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