ActionScript 2.0 :: Random Sound Event?

Mar 25, 2002

i am trying to write a script that generates a random sound. i like to make it a framescript but i am not sure how to do this, so i appended it to a movieclip (see below) but this doesn't work..

onClipEvent (enterFrame) {
randy = random(5);
if (randy=1) {[code]....

View 5 Replies


Similar Posts:


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

ActionScript 3.0 :: Random Sound With An Array?

Dec 23, 2009

I would like to use an array to play 5 sound files randomly.Here's the code I've got so far! Can anyone tell me what code I'm missing?

var my_sounds:Array = [Sound1, Sound2, Sound3, Sound4, Sound5];
var s1:Sound = new Sound(new URLRequest("GentleSeaOnFlatBeach.wav"));var s2:Sound = new Sound(new URLRequest("SPLASH.wav"));var s3:Sound = new Sound(new

[code]......

View 1 Replies

ActionScript 3.0 :: Way To Pick Random Sound

Oct 20, 2010

I've spent the last few days trying to find an answer to this seemingly simple question, and no luck. Well, partial luck, but not quite what I wanted.

My problem is this - I want to play a random sound when an event happens. In AS2, I used to do this[code]...

View 5 Replies

ActionScript 3.0 :: Play Sound At Random?

Oct 19, 2011

I'm working on a new AS3 project in Flash CS4. This is my second major project, and for some reason, when I enter a new frame, a sound from my library plays when it's not supposed to. It plays once, when I enter the frame. The thing is, there's no code that would initiate it to do so. In my first major project, it did the same thing. I figured I screwed something up since it was my first project, and ignored it -[code]...

View 9 Replies

ActionScript 2.0 :: Random Sound On Click?

Dec 19, 2006

Anyone know how to make a sound (picked at random from a selection in the library) play when a button is clicked?

View 2 Replies

ActionScript 2.0 :: Random Function With Sound?

Mar 3, 2007

I am working on a piece now that will have 10 invisible MC's (1-10) stacked on frame 1 in seperate layers that function like buttons on the main timeline. Each of these mc's will trigger a corresponding mc (A-J) to become visible and play and also start a sound file. This I have all worked out.

What I am writing about is a random function. When 1 triggers A, I would like one of five distinct MC's inside of A to be randomly selected to play, both with sound and with image.

Right now I'm working on the random function with sound, and I'm in need of soome assistance. I'm not sure of my approach, but why I'm stuck in particular now is because ususally when attaching a sound to an MC, when the sound is called it is through the name of the sound rather than the mc name and as I've created a random function I can't very well call the sound name as then it won't be random. Here's what I've got:

sound1 = new Sound(soundHolder1_mc);
sound1.attachSound("chime");
sound2 = new Sound(soundHolder2_mc);
sound2.attachSound("psychic");

[code]...

View 1 Replies

IDE :: Loading Random Sound Clips?

Aug 26, 2009

I was wondering if somebody could point me in the right direction to be able to load in a random sound clip (from a set of 5 or more mp3s) when the user rolls over a button. I can't seem to find a way to do this.

View 14 Replies

ActionScript 2.0 :: Play A Random Sound From Array?

Mar 22, 2009

I have 30 sound clips, each named s1, s2, s3 etc...

i want to create an array so when it enters the frame it will play a random sound from the array.

View 1 Replies

ActionScript 3.0 :: Play A Sound With Random Pitch?

Feb 16, 2009

I'm looking for a way to play a sound with slightly altering pitch to make it more "interesting" (read: tolerable).

I've previously used it with great results in java programming with the Slick library. Simply asked the sound to be played at 0.9 - 1.1 of original pitch (1 = default), gave a subtle but awesome effect.

View 0 Replies

ActionScript 3.0 :: Sound And Video Within A Random Function?

Apr 23, 2010

I've designed an interactive quiz that has 10 questions, and for each question 3 possible answers (obviously only one of which is right), however I'd like to add some sound to certain questions and a small video clip. The only issue I'm having, and I've not been able to get my head around. I've loaded all the questions and answers into arrays, and used the random function to display them in a different order each time, and because of this I'm having trouble figuring out how I'll be able to implement the use of sound and video into the project.

I'll post the code so far below as to give a better idea of what I'm trying to do, and what I've done so far.

Frame containing Array function:

[Code].....

View 0 Replies

ActionScript 2.0 :: Several Random Sound Linkage And Some Sort Of Pu?

Aug 15, 2005

I have to design a game for a school project that I have to redo to pass my year, but so far I have encountered several problems. My game is for children from 6 to 8 years old, so the game has to have a lot of sound (voice recordings) to explain the menus and the stuff they have to do.

[Code]...

View 8 Replies

ActionScript 2.0 :: Have A Random Sentence Generator, But How To Add Sound To It

Aug 28, 2007

I have a code that randomly generates a random sentence:[code]...Now on every word, I have a sound clip that I want to play, but how would I code it? I dont know I would I would assign a sound to a word or how to incorporate it into the coding above

PHP Code:
if(name "example"){mysound = new Sound();mysound.attachSound("example");mysound.start();}

[code].....

View 1 Replies

ActionScript 2.0 :: Using Number From Random Array To Attach A Sound?

Jan 4, 2010

I have a foreign language resource which randomly creates and displays a number. The player then needs to select the correct number in a particular foreign language. What i also need to do is play the audio for the randomly created number. I have numbers 13-20 all as seperate sound files also named as identifier names 13,14,15 etc up to 20.

The following script loads the sounds. Sound1 is the sound which needs to hold the random number which is generated:

ActionScript Code:
onClipEvent(load){
Sound1 = new Sound();
rndClip = ????????;

[Code]....

I need to load this array as Sound1 so that the correct sound file plays to match the random number.

View 2 Replies

ActionScript 2.0 :: Button Loads Random Sound Clip

Apr 18, 2011

I am a voice over artist and I'd like to have a button and when you click it, it loads one of say 20 mp3s stored...wherever. It can be in the flash movie itself...but I'd rather the script access a directory on my server, that way the movie itself doesn't take long to load.

View 2 Replies

Professional :: Sound Synch: Stream Vs Event

Apr 23, 2010

I'm working in Flash CS3. My animation is about a minute long, with a single audio track that plays from beginning to end. The sound quality is noticably better when I set the synching to Event, but unless I set it to Stream the sound falls behind the animation. Is there any way to maintain proper synchronization with the Event setting? Also: will the lag be consistent on different machines and players? I thought about adjusting the timing of the animation so that it matches the Event-set sound in playback, but that's such a clunky a solution it seems likely to cause other problems.

View 2 Replies

Flash :: Plays Unwanted Sound On DOWN Event?

Feb 27, 2011

I'm newbie in flash. I have created a button - it looks perfect. I got seperate keyframes for UP, OVER, DOWN and HIT events. The OVER (and only it) has assigned the sound. The problem is flash plays sound (assigned to OVER) for DOWN event (no sound assigned). I have no idea what is wrong, tried everything with this. I am unable to find soultion,

View 2 Replies

ActionScript 3.0 :: Sound Streaming Event Trigger?

Apr 18, 2011

I'm streaming an external MP3 (around 3 mb file) with the following method:

ActionScript Code:
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.net.URLRequest;

[Code].....

With that i have no problem, where i am completely lost is the possibility of triggering an event after de 15 seconds (first parameter of SoundLoaderContext) are loaded, ie, adding an event listener or something like that.

View 2 Replies

ActionScript 2.0 :: Button To Stop A Sound Event?

Aug 3, 2007

code to apply to a button to stop a sound event.

I have a series of buttons, when pressed they play a sound event, but when you click on the next button, the previous sound is still playing.

View 7 Replies

ActionScript 3.0 :: Sound Played On Keyboard Event?

Apr 24, 2011

I'm creating kind of a pseudo RPG menu, and I just have the animation go to a different frame when you press an arrow key, backspace, or enter. I also have a couple of sound effects I wanted to play depending on what you press, but I am having no luck at all getting it to work, and everywhere I look online has very different instructions on how to go about it. Here's what I have just without any sound at all:

[Code]....

And then just different numbers based on what frame I'm on. As I said, I don't really know what I'm doing; a lot of this code was given to me. :/ So I know it's a lot to ask, but if I could get a very detailed explanation of what to do, If the sound could play before it switches frames, that would be best.

View 2 Replies

ActionScript 3.0 :: Event Listener Function To Throw Out Unique Random Numbers Between 1 And 30

Jul 23, 2009

I want my event listener function to throw out unique random numbers between 1 and 30. How does one do that in as3? Math.round will repeat values.?

View 2 Replies

ActionScript 2.0 :: How To Use Playing Sound To Trigger Event On Completion

May 27, 2009

I'm trying to use a playing sound to trigger an event when it finishes:
onSoundComplete = function(){
redbtn._alpha = 100;
redbtn.enabled = true;
}
I have the button fading and disabling nicely (on (release)) but when the sound stops playing, I need them to return to alpha 100 and enabled=true. It doesn't work but there's no error generated either.

View 1 Replies

ActionScript 3.0 :: Sound Object - Event Complete Does Not Work

Apr 10, 2010

Sound object. Event complete doesn't work
function init() {
this.soundsArray[i-1].addEventListener(Event.COMPLETE, completeSoundHandler);
this.soundsArray[i-1].play();
this.blHit=false;
} function completeSoundHandler():void {
[Code] .....

View 1 Replies

ActionScript 3.0 :: Loaded Sound Will Not Play On Mouse Event

Jul 13, 2010

Why won't my sound play? It should play on MousOver and stop on MouseOut...

stop();
import flash.display.MovieClip;import flash.events.MouseEvent;
var req:URLRequest = new URLRequest("squeeak.wav");
var sound:Sound = new Sound();
var controller:SoundChannel;
function soundLoaded(event:Event):void{
[Code] .....

View 3 Replies

ActionScript 3.0 :: Trigger An Event When Any Sound In A Soundchannel Completes?

May 3, 2011

I have a soundchannel, and I'm playing a lot of sounds in it, but I need the completion of any sound file within that channel to be followed by a wait of two seconds, then trigger an event. How can I do this?

View 4 Replies

Professional :: Sound Class - Use Event Listener - How To Get Functionality?

Jul 5, 2011

i have got all my public vars for sound class but im having trouble on how i would execute them because i normal would use event listener but its OOP lol so how do you get that functionality ?code in star.as file:
 
package {
import flash.display.MovieClip;
public class star extends MovieClip    {[code]......

View 2 Replies

Actionscript 2.0 :: Sound On Event Select All(explode) Is Triggered

Jul 23, 2009

I want a sound to play every time Code: Select all(explode) is triggered. I have had little success trying to attach audio when it happens, so i decided to make an empty 2 frame long movie clip, frame one has Code: Select allstop(); for obvious reasons, and frame 2 has no action but it has the sound "blast".

[Code]....

Is the code i'm using, i am getting no error reports but no sound is being played. What am i doing wrong? (the audio i want to play is named blast and has an export name of blast, the movie clip is named blastmc and has an export name of blastmc)

View 2 Replies

ActionScript 2.0 :: Change The Tempo/pitch Of A Sound When An Event Happens?

Feb 2, 2006

I'd like to know if it is possible to change the tempo/pitch of a sound when an event happens? So I just like to speed up a looping sound...

View 2 Replies

ActionScript 1/2 :: Get High Quality Sound In Stream Mode In Timeline Not In Event Mod?

May 6, 2010

How to get a high quality sound in Stream Mode in the Timeline not in Event Mod? In Stream Mod the sound played in the timeline is HQ but after .swf export it gets in really bad quality

View 5 Replies

Actionscript 3.0 :: Sound Event Listeners - Load Some Of Flash Movies A Bit Faster

Apr 16, 2010

I am trying to load some of my Flash Movies abit faster. I had read somewhere that i should use certain commands to bring the sounds out of the library after the SWF or page is loaded. I think i am suppsed to use Event listeners or call on the sounds somehow?? Does anyone understand what i am saying OR have any tutorials or links to tutorials that i can look at with regards to calling sounds?

View 1 Replies







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