Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Sound Has A False Start



I used a behaviour to load external sounds, voice overs, for each of my cast members on my site. Out of 10, 2 of them don't work well. On slow connections the two bad ones start to play immediately then stop, waits to download the rest then continues.

I have a movie clip and when you click on a button to a cast member it activates another movie clip within it, and inside that is the behaviour code:

//Load Streaming mp3 behavior
if(_global.Behaviors == null)_global.Behaviors = {};
if(_global.Behaviors.Sound == null)_global.Behaviors.Sound = {};
if(typeof this.createEmptyMovieClip == 'undefined'){
this._parent.createEmptyMovieClip('BS_mySound_snd' ,new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.mySound_snd = new Sound(this._parent.BS_mySound_snd);
} else {
this.createEmptyMovieClip('_mySound_snd_',new Date().getTime()-(Math.floor((new Date().getTime()) /10000)*10000) );
_global.Behaviors.Sound.mySound_snd = new Sound(this.BS_mySound_snd);
}
_global.Behaviors.Sound.mySound_snd.loadSound("Lou is-VO1.mp3",true);

Each movie clip for has the exact same code except that they reference a different mp3. All the mp3's have been compressed exactly the same.

Any ideas, appreciate any help as to how to stop the false start.

You can visit the site www.connectid.net/AN and click on "Cast" to see what I'm talking about.

Also, if anyone knows, could you tell me if it's bad that my file size is just over a meg?

Thank you,

TheOnyxGuy



ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 09-06-2006, 04:54 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Sound Start Doesn't Start
I've been experiencing this problem. Sound.start() doesn't always start. A lot of times, it does, sometimes, it doesn't start for me. Sometimes it happens even after sound load has just finished. Has anyone experienced the same? any suggestions?





























Edited: 08/24/2007 at 01:26:57 AM by nehcdet

Random Sound Load And Start Is Speeding Up The Sound. Any Help?
Hello,

My first post here at Kirupa. I thought I'd give it a try.
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.

I'm new to AS. Any help or insight into the issue would be much appreciated!

Thanks everyone!


ActionScript Code:
var crows = new Sound(this);    crows.loadSound("Raven.mp3", false);    crows.setVolume(100);rNum = function(){    var i = 0;    var randNum = Math.round(Math.random()*500);    if (i>=randNum) {        crows.start(0, 1);    }};randSound = setInterval(rNum, 100);

Need Start And Stop Sound Help ON AND OFF BUTTONS FOR SOUND PLZ
ok I have a Flash site iM making with BG music but I need a START and STOP Button and a Next and Prev button for the music so PLEASE help me out with this is u can I need FULL instructions

Sound.stop Is OK, Sound.start ?
I create a button that stop sound, but i do not know how to create a button that will start to play that sound again.
I try with sound.start but does not work, pleas help?

Sound Stop And Sound Start
Hi There.

I have the follwoing problem. I have this play/pause button that toggles. This works. When clicking it the movie freezes and when clicking it again it runs. I have now added sound to the timeline, and what I want is that when clicking the pause button the movie freezes but also the sound freezes. Clicking the pause button again should start the movie and the sound again.

I have written the follwoing actionscript to the button:


Code:
isPaused = true;
allSounds=new Sound();

this.movieClip.play_btn.onRelease = function() {
isPaused = !isPaused;
movieClip.gotoAndStop(isPaused ? 1 : 5);
stop();
_root.allSounds.stop();
if (isPaused==true) {
play();
trace("We are rolling");
trace("and this is frame "+_root._currentFrame);
_root.allSounds.start(0,99);
}
}
It does half of it good. When I now click the button, the movies freezes and the music stops. When I click again the movie starts again, except that I do not hear any sound anymore. I am sure it is just some simple error, but any tips would be welcome!

Thnx!

Stop Sound To Start Another Sound
I have a movie -a read aloud ebook for kids-with a main soundfile, and buttons with soundfiles (definition of the word in the text). I need to be able to click on the word definition button, stop the main soundfile, listen to the word definition button soundfile, then return to the main soundfile. Everything in the movie works perfectly except that with the code below (on each button), on rollOver ALL sounds are stopped, and I can't work out how else to do it. Can anyone show me how to do this without the onRollover please?

on (rollOver) {
stopAllSounds();
}
on (press) {
_root.play();
}
on (release) {
_root.stop();
_root.btnStopPlay.attachMovie("mcButtonPlay", "btnPlay", 1);
}

Sound... 3, 2, 1, Start();
Hey

I having a problem with a sound. I've got a sound in a movieClip; I've got a Volume slider and Pan slider which control the setVolume() and setPan() for the sound... all of this stuff works like a fine(surprisingly!!) My problem is when I turn the sound OFF... I can't turn it ON again.

I've tried both _parent.soundTrack.play(); and _parent.soundTrack.start();
I was suggested to use ".start();" for sound. I don't know, it doesn't seem to work.

The soundTrack movieClip is sitting a notch higher than the ON/OFF button. Also, I am not accessing the sound directly through the movieClip's InstanceName, but instead through a variable using attachSound();... I know, maybe that has something do to with it? I know that the path structure is at least partly correct because I'm able to turn it off... just not on again.

Any suggestions?
Thanks,
JM Guitard

Start Sound
I am creating a slide show in Flash MX Professional and I have imported an avi with sound. I need the sound to stop playing when I move to the next slide which I have managed using the stopallsounds command, however when I press the back button to go back to the page with the movie on the sound obviously won't play. I have tried the start.sound command but can't get it to work. Help!
(Also when the slide show starts a 1 second clip of sound is heard - have tried the stopallsounds command on this page but that doesn't work)
Would be grateful for any help:confused:

Sound Will Not Start
help....

my movie has 16 sound files

the stop button works but when I press play the movie continues but that particular sound stops.

i know i have to id the sound but i don's know where it should go.

here's the code

var stopped_ = true;
_global.roo = this;
var mySound = new Sound(roo);
mySound.attachSound();
//



button1.onPress = function() {
MovieClip.prototype.onEnterFrame = function() {
if (_root.direction == "stop"){
this.stop();
p = Math.round(mySound.position/1000);
mySound.stop();
}else {
this.play();
}
}
_root.direction = "stop";
}
button2.onPress = function() {
_root.direction = "go";
mySound.start();
//delete MovieClip.prototype.onEnterFrame;
}

Sound.Start
Hi,

I have a sound playing on hit, however when theres x2 or x3 hits on the object it plays the sound over the top which I don't want it to do, can this be fixed?


ActionScript Code:
if (this.hitTest(_root.Jet)){//if the enemy hits the player
var sound:Sound = new Sound();
sound.attachSound("explosion");
sound.start(0,0);

Start Sound ?
I tried a search for this issue I have but I didn't find anything. I tried a few different search parameters but nothing was helpful.

I have menu and on my menu buttons I am using the following to start and stop my attached sound's. The sounds are loaded on the main time line.


ActionScript Code:
_root.bgSound.stop();
_root.bgSound.start()

I have two music tracks that play at different times during the movie. Track one plays the Intro and sections 1, 2 and 3 and Track two plays the Conclusion. My menu stretches the full length of the movie. Now if track two is playing and I select a menu button that takes me back to section 1 , I need to stop track 2, and start track 1.


What I want to know is what script would I use on my buttons to start track 1 or track 2?

Sound .start(); Bug
Hi, im creating MP3 player with CS3
So the bug i got is like this
Code:

var posToPlay = Math.floor((sDurator.sRMover.x / 247) * xml.music[cps].attribute("length"));
SoundMixer.stopAll();
sc = s.play(posToPlay * 1000);
sDurator.sRMover.stopDrag();

length = 73 it;s in seconds
and when i what to set other song position it set it wrong i get critical bug
it plays about 80% of the song i get 'Send as a report', 'Don't send as a report'
and duration of the songs gets from 73 to about 60
What's? wrong i have no idea?

When A Sound Stops Playing So It Can Start Playing Another Sound :Monitoring Playback
I'm attempting to do a very simple thing and I'm very perplexed. My girlfriend is an opera singer and all I'm trying to do is advance the audio track when the song finishes playing to go to the next frame. On the surface it seems easy, however I can't seem to figure it out. Perhaps you can help?

Check out the movie here: http://www.earthgrid.com/earthgrid/valentina.html


Here's my code its on frame 2 in the movie



Code:
stopallsounds();
s2.close();
s3.close();
var s1:Sound = new Sound();
s1.loadSound("Agnus_Dei.mp3", true);
s1.start();
stop();
Explanation:: the flash movie has buttons that allow you to navigate between the 3 different music tracks.

when you click on a button, first I close the loading of the previous track, ie. s2 and s3, if they are still loading.

What I'd like to do is insert a command that advances to the next track (which happens to be on the following frame, 3) ONLY when the first audio track is finished PLAYING, not finished 'loading'

something like:
s.addEventListener(Event.SOUND_COMPLETE, gotoandplay (3);
);

so that when Agnus Dei finishes playing it goes to the next frame which starts the next track.

but that' doesn't seem to work.

I found this URL in Adobe's support site:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000283.ht ml

it says this:

Your application might want to know when a sound stops playing so it can start playing another sound, or clean up some resources used during the previous playback. The SoundChannel class dispatches an Event.SOUND_COMPLETE event when its sound finishes playing. Your application can listen for this event and take appropriate action, as shown below:


Code:
import flash.events.Event;
import flash.media.Sound;
import flash.net.URLRequest;

var snd:Sound = new Sound("smallSound.mp3");
var channel:SoundChannel = snd.play();
s.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);

public function onPlaybackComplete(event:Event)
{
trace("The sound has finished playing.");
}
>> However, when I try to paste in this code into a frame in Flash CS3 it gives an error saying I have to put it in a 'package'
I tried that, putting this code into a file and saving it as a .as file


I really don't get how to do this Package thing in CS3, so I couldnt get the example to work.

If so please contact me Please help!

SOUND.START Problem
Hello.

I'm trying to make "PLAY" and "STOP" buttons for a loopping sound which I placed in a movie clip.

I put my sound inside a movie clip called loop.
I then put the movie clip instance of loop on the stage and give it an instance name called "loop1".

I then created another movie clip called control, in which I created a sound object called "loopa"
Like this:

loopa = new Sound();
loopa.attachSound(_root.loop1);

I then put two buttons on the stage called "Play" and "Stop"
with the following actions attached to each:

Stop button:

on (release) {
loopa.stop();
}

Play button:

on (release) {
loopa.start();
}

When I test the movie the "STOP" button works but the "PLAY" button does not.

Anyone got an idea why?

Thanks in advance.

How To Stop And Start Sound
I have a flash file which has a movie clip that contains sound. The instance name of which is 'soundMovie'. I have placed the movie clip on the stage. NOw when I run the file I can hear the sound. THe problem is with the following script that I have placed on the first frame of the main movie timeline (NOT THE MOVIE CLIP CONTAINING THE MUSIC). i.e when the following script is attached to the first frame, the music stops. my question is why doesnt the music start if I have written soundobj.start(). If I remove the live soundobj.start it runs fine. any help would be highly appreciated !!!!

soundobj = new Sound(_root.soundMovie);
soundobj.stop();
soundobj.start();

Start & Stop Sound
I am playing a wave file and would like to let the user start or stop the sound if they want. What is the best way to do this?

Thanks

Sound: Start-Stop
I have a movie that you can start and stop at different points on the timeline (whenever you press play or stop). I would like to add a narrative sound track that will start and stop at the same time as I start and stop the movie, without the sound going back to the beginning.

Does anyone know how to achieve this or know of a link to a tutorial which explains how to do this?

Thanking you!

Luke

Sound.start Question
I have a 40 sec piece of music in my flash movie. Im trying to set the music to start at different time intervals in the 40 sec piece. My problem is that it doesnt seem to start at that designated place. Perhaps my code is wrong or perhaps my music piece is too long for flash. Here is my current code:-
This is on the play button:-

// _root.fr is always between 2 and 7;
_level0.mySound.stop(); // reset sound first
time = (30/12)*(_root.fr-1);// 12 is frame rate
_level0.mySound.start(time, 1);


Any advice would be appreciated

Loaded Sound Won't Start On Mac
Hi all,

I'm loading some mp3's from a folder on the server via the flash 6 loadSound method.

The sound is supposed to preload and then start.

It starts fine on a PC but not on a Mac.

If you're on a mac check out http://www.paulnoble.co.uk/test and you'll se what I mean...

//I'm using the following function

function loadLoop() {
scopeLoop = new Sound();
scopeLoop.loadSound("loops/loop"+loopNum+".mp3", false);
}

//And this code to preload and start the loop


loopTotal = _root.actions_sound.scopeLoop.getBytesTotal();
loopLoaded = _root.actions_sound.scopeLoop.getBytesLoaded();

if (loopLoaded == loopTotal and loopLoaded > 10) {
_root.actions_sound.scopeLoop.start(0,99);
_root.preloader.gotoAndStop("off");
gotoAndStop("off");
}

Can anyone shed some light on why the loop might not be starting on a mac?
[Edited by mrming on 08-13-2002 at 11:48 AM]

Pause/start Sound
Hi,

If I want to make a movie pause/start at the click of a button, i use this.start(); and this.stop(); and it works fine. However, the movie has a narration, so if the movie pauses, I want the sound to pause also. When the movie unpauses, I want the sound to pick up from where it left off. Is there a way to to this?

Thanks,
Tim

Pause/start Sound
Hi,

If I want to make a movie pause/start at the click of a button, i use this.start(); and this.stop(); and it works fine. However, the movie has a narration, so if the movie pauses, I want the sound to pause also. When the movie unpauses, I want the sound to pick up from where it left off. Is there a way to to this?

Thanks,
Tim

Sound Start Over Problem PLEASE HELP
ok here is my actionscriptfor a button that plays one sound and stops four others at the same time. i need it so when i press this button twice , it doesnt play it twice at one time. it sounds really messy. please help me?!

on(press){
s3 = new Sound();
s3.attachSound("SS3");
s3.start(0);

s3.stop("SS1");
s3.stop("SS2");
s3.stop("SS4");
s3.stop("SS5");}

thank you
scott

Start One Sound, Stop Another
I am using this code on the first frame of my movie:

stop();
_root.soundb.onRelease = function(){
mySound = new Sound();
mySound.loadSound("sounda.mp3", true);
}
_root.soundb.onRelease = function(){
mySound = new Sound();
mySound.loadSound("soundb.mp3", true);
}
_root.soundc.onRelease = function(){
mySound = new Sound();
mySound.loadSound("soundc.mp3", true);
}

Each button works perfect EXCEPT, when one button is clicked, I want the previous sound if any, to stop before the new clip starts. How do I modify my code to make that happen?

Thanks

Sound Doesn't Start
hi all,

my problem is i have sounds loaded in my movie, i call them via mysound.start(); it works if i make a test scene or debug movie, but not in my exported swf...all other sounds work...

may some one help me..?

thx

Button To Start Sound
I am using Flash 2004, and I was wondering how to have a button play a sound when a user clicks on it. When the button is pressed it would play a short wav file and then repeat the wav until the user releases the button.

Start Sound For Flash MX
I need to find a way to start a sound on mouse release in such a way that when the stop button has been clicked and the animation halted, once the play button is clicked the sound and animation will start back up from the playhead's last position. Maybe using streaming audio works, but I am VERY new to Flash and I need some simple instructions on how to do this. Any help is greatly appreciated!

MX 2004 Pro (start Sound) ?
Well...
i am using fash mx 2004 pro

and flash MX scripts dont work there

in MX (start sound) is

code:
on (release) {
stopAllSounds();
_root.loop.gotoAndPlay(2);
}


Works only in MX nor in MX 2004 pro
But this script works fine

code: on (release) {
stopAllSounds();
}

Wolrks in MX and MX 2004 pro
Then only problem is , how to use code: _root.loop.gotoAndPlay(2);
In MX 2004 pro ?

I tryd to find Auto script in list but dident find...



I just need a button to start sound In MX 2004 pro...

AND what script i need in MX 2004 to replay sound i want so that one sound keeps replaying all the time ?


Thanks...

Set Sound Volume To 0 At Start Of Mc?
i have a sound that plays from the begining, but the sound volume has to be set at 0 volume. want a option to turn volume to 100 with a flick a button. not on/off sound control.

any one help?

Sound Will Not Start Playing Again
help....

my movie has 16 sound files

the stop button works but when I press play the movie continues but that particular sound stops.

i know i have to id the sound but i don's know where it should go.

here's the code
var stopped_ = true;
_global.roo = this;
var mySound = new Sound(roo);
mySound.attachSound();
//



button1.onPress = function() {
MovieClip.prototype.onEnterFrame = function() {
if (_root.direction == "stop"){
this.stop();
p = Math.round(mySound.position/1000);
mySound.stop();
}else {
this.play();
}
}
_root.direction = "stop";
}
button2.onPress = function() {
_root.direction = "go";
mySound.start(p, 0);
//delete MovieClip.prototype.onEnterFrame;
}

Can't Get Sound Object To Start
Hi All,

I am using Flash MX 6.0. I am trying to build a very simply MP3 player that loads its song list from a text file. I have a pause button that stores the position of the sound object and then calls the stop method on the sound object. Then I have a play button that calls the start method on the sound object using the position as a parameter. However, it will not start. I have tried just calling start with no parameters and I can't figure out what is wrong. I have posted my .fla if anyone could please have a look and see what I am doing wrong. I am completely new to this stuff. Thanks.

http://www.deimde.org/flash/SimplePlayer.zip

Sound.start Question
Hi I have a movie where i would like to assign a function to this

ActionScript Code:
mySound.start =  function(){
//do stuff
}
The problem is that when I assign this function the sound no longer plays but just the function runs.How can i use mySound.start to use a fucntion at the same time?

Stop Start Sound
Can any of you geniuses help me i have a website with a background sound thats embeded in a player see www.imageworksltd.com on the site i have a few .flv movie files when someone plays the movies i want the background sound to fade out so you can hear the movies and if poss fade back in when movie finished im not a programmer so its all far fetched for me thanks in advance Alistair

Have A Problem With Sound.start
Hi, I'm creating an Mp3 player in flash, and for some reason I can't get one of my functions to work properly. Here is my code:


Code:
var nowPlaying:Sound = new Sound();
var whichSong:Number = 0;
var songList:Array = new Array("C", "s", "T");

function nextSong() {
var tempVar:Number = songList.length - 1
if (whichSong<tempVar) {
whichSong++;
var Song:String = songList[whichSong];
trace(Song)
nowPlaying.loadSound(Song+".mp3");
playSong()
}
}

function playSong() {
nowPlaying.start(0, 99);
trace(nowPlaying)
}

play_btn.onRelease = playSong;
next_btn.onRelease = nextSong;
The play button works fine. The next button works fine until it reaches the call to playSong(). The function executes because it traces [object, Object] (refering to nowPlaying), but the sound doesn't start playing until I press the play button.

Am I missing some thing obvious? I tried adding _root infront of nowPlaying.start(0, 99) because I thought it might be an issue with scope, but I had the same problem.

Can someone help me out here?

Start On Sound On Load
I have this script that loads a audio file but only starts it after hitting the play button. What do I need to add to this script in order for this to start when the movie loads?


ActionScript Code:
//----CODED BY CRAIG CAMPBELL AT SCHOOL OF FLASH--------//
//-------- [url]http://www.schoolofflash.com----------//[/url]

var music:Sound = new Sound(new URLRequest("walk.mp3"));
var sc:SoundChannel;
var isPlaying:Boolean = false;
var pos:Number = 0;
var soundVolume:Number = 1;
var muted:Boolean = false;

mute_mc.buttonMode = true;
volume_mc.slider_mc.buttonMode = true;

pause_btn.addEventListener(MouseEvent.CLICK, pauseMusic);

function pauseMusic(e:Event):void
{
    if (isPlaying)
    {
        pos = sc.position;
        sc.stop();
        isPlaying = false;
    }
}

stop_btn.addEventListener(MouseEvent.CLICK, stopMusic);

function stopMusic(e:Event):void
{
    if(sc != null)
    {
        sc.stop();
        pos = 0;
        isPlaying = false;
    }
}

play_btn.addEventListener(MouseEvent.CLICK, playMusic);

function playMusic(e:Event):void
{
    if (!isPlaying)
    {
        sc = music.play(pos);
        isPlaying = true;
    }
}


//---VOLUME SLIDER---//
var dragging:Boolean = false;
var rectangle:Rectangle = new Rectangle(0,0,100,0);
volume_mc.slider_mc.addEventListener(MouseEvent.MOUSE_DOWN, dragIt);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);

function dragIt(e:Event):void
{
    volume_mc.slider_mc.startDrag(false,rectangle);
    dragging = true;
    volume_mc.slider_mc.addEventListener(Event.ENTER_FRAME, adjustVolume);
}

function dropIt(e:Event):void
{
    if (dragging)
    {
        volume_mc.slider_mc.stopDrag();
        volume_mc.slider_mc.removeEventListener(Event.ENTER_FRAME, adjustVolume);
        dragging = false;
    }
}

function adjustVolume(e:Event):void
{
    mute_mc.gotoAndPlay("On");
    soundVolume = volume_mc.slider_mc.x / 100;
    var st:SoundTransform = new SoundTransform(soundVolume);
    if (sc != null)
    {
        sc.soundTransform = st;
        muted = false;
    }
}

mute_mc.addEventListener(MouseEvent.CLICK, mute);

function mute(e:MouseEvent):void
{
    if (sc != null)
    {
        var st:SoundTransform;
        if (muted)
        {
            st = new SoundTransform(soundVolume);
            sc.soundTransform = st;
            mute_mc.gotoAndStop("On");
            muted = false;
        }
        else
        {
            st = new SoundTransform(0);
            sc.soundTransform = st;
            mute_mc.gotoAndStop("Mute");
            muted = true;
        }
    }
}

Delaying The Start Of A Sound
I' am new to Flash ActionScript 2 and 3. I'm working on a project that involves several audio clips.
I would like to delay the start of audio clips at least 2 seconds.
Each sound is at the begining of a new page.
I used the following script unsucessfully. Please help!
The name of the sound is p32a.mp3

Here is the script
- - - - - - - - - - - - - -
var playIt:Number;

function playS(){
mySound = new Sound();
mySound.attachSound("p32a.mp3");
mySound.onSoundComplete = function(){
stopAllSounds();
}
mySound.start();
clearInterval (stopS);
stopS = setInterval(playIt, 2000);
}
function (playIt) {
clearInterval(stopS);
}

Sound.start() Problems
hi all, I am having major troubles, i've never worked directly with sound in flash b4, and i can't work out how too make this code work:

function SAP() {
sound.stop("forgottenme");
gotoAndPlay("9", "1");
}

mysound = new Sound();
mysound.attachSound("forgottenme");
mysound.start();
mysound.onSoundComplete = SAP;

I just want to synchronize a sound, "forgottenme", using onSoundComplete to go to scene 9, 1st frame. Can someone please tell me why this isn't working... maybe it's not "forgottenme", thats the name i assigned it in the library, am i meant to put another name there?

And PLEASE DO NOT tell me it is in help, I have looked, and I cannot understand it... can someone please tell me why this is not working?!

Thanx all... listnin 4 a reply

Start Sound Immediately...?
http://www.kirupa.com/developer/mx/volume_slider.htm

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...

so far i tried is:

onClipEvent (load) {
mySound = new Sound();
mySound.loadSound("_jUsT-Rudy_Ves-8003_hifi.mp3", false);
mySound.onLoad = playSound();
function playSound(success) {
if (success) {
mySound.start();
}
}
}
onClipEvent (enterFrame) {
downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
if (downloaded != total) {
_root.dl = "downloading song...";
} else {
complete = 1;
_root.dl = "playing";
}
mySound.setVolume(_root.volume*2);
}

where i a going wrong...???
help me

Sound Start Problem...
Hey gang,
Quick question thats been driving me insane. I am trying to start a sound (intro.mp3) at a certain frame in an MC. The sound has been loaded from an external mp3 in a class already. All my other sounds work, but they are all triggered by events. Do i need to sync it to an event? Can i just use intro.start() on a specific frame in my mc? This is driving me crazy and is the LAST step for a poject for class ive been working on forever. Any help would be greatly appreciated. Thanks!
Garrett
PS... Here's the important code snippets.

Code:
//Loading the sound
interfaceClass.prototype.gameSounds=function(){
intro= newSound();
intro.loadSound("intro.mp3", true);
}
//initializing the sounds
ui=new interfaceClass();
ui.gameSounds();
//AS on frame 115 of MC TitleAnim to start sound on sync with animation
ui.intro.start();
What am I doing wrong? The sound never starts where it should, and Im tearing my hair out. Help!

Sound.start() Problems
hi all, I am having major troubles, i've never worked directly with sound in flash b4, and i can't work out how too make this code work:

function SAP() {
sound.stop("forgottenme");
gotoAndPlay("9", "1");
}

mysound = new Sound();
mysound.attachSound("forgottenme");
mysound.start();
mysound.onSoundComplete = SAP;

I just want to synchronize a sound, "forgottenme", using onSoundComplete to go to scene 9, 1st frame. Can someone please tell me why this isn't working... maybe it's not "forgottenme", thats the name i assigned it in the library, am i meant to put another name there?

And PLEASE DO NOT tell me it is in help, I have looked, and I cannot understand it... can someone please tell me why this is not working?!

Thanx all... listnin 4 a reply

Start Sound Immediately...?
http://www.kirupa.com/developer/mx/volume_slider.htm

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...

so far i tried is:

onClipEvent (load) {
mySound = new Sound();
mySound.loadSound("_jUsT-Rudy_Ves-8003_hifi.mp3", false);
mySound.onLoad = playSound();
function playSound(success) {
if (success) {
mySound.start();
}
}
}
onClipEvent (enterFrame) {
downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
if (downloaded != total) {
_root.dl = "downloading song...";
} else {
complete = 1;
_root.dl = "playing";
}
mySound.setVolume(_root.volume*2);
}

where i a going wrong...???
help me

Massive Sound.start(7,0) Offset Bug
Has anyone noticed that on setting an offset value to the start() method eg
Code:
mySound.start(7,0);
of a long 10 seconds + sound length, the sound fails to play all the way through to the end when you use a high offset!

Eg try the following code with a sound of around 10-20 seconds in length:

On _root

Code:
mySound=new Sound(this);
mySound.attachSound("soundtoAttach");



Code:
//on button 1
_root.mysound.start(0,0);

//on button 2
_root.mysound.start(3,0);

//on button 3
_root.mysound.start(8,0);
//on button 4
_root.mysound.start(10,0);


I think this is a bug as it gets the offset correct and plays the sound, but fails to reach the end!
Cheers

Sam

How Do I Have One Button That Can Stop/start A Certain Sound?
How do I have one button that can stop/start a certain sound? I mean that when I click it, it will stop the sound, then start it again when you click it again. Please help.

Thanx in advance.
l8er dude

How Do I Start And Stop The Sound On The Same Keyframe ?
How do i start and stop the sound on the same keyframe ?

Help Please... Load Movie But Sound Won't Start
Hi all,

I've read through Kenny Bellew's tutorial (See here ) and it's SO useful that helps me created a sync flash movie very precisely. However, I have encountered an issue but can't find any answer.

Let's say I have a BASE movie (BASE.swf), which is to LOAD another movie on top to play a background music ("BGM_Loop.swf") - because I need a non-stop BGM. I load that BGM movie to level 100.

To avoid confusion, the BGM is loaded into a frame directly without using any ActionScript in the BGM_Loop.swf. In the BASE.swf the code is -

"loadMovieNum("BGM_Loop.swf", 100);"

on frame #1 of it.


Then, from the BASE.swf movie, I need to load a third movie ("audios.swf") which has 10 audio files with 10 scenes.
I've loaded it into level #1 on frame #10 of "BASE.swf".
The code is -


loadMovieNum("audios.swf", 1);


This "audios.swf" movie has 10 pieces of audio which are using the ActionScript code in the tutorial to sync with the animation. here's a sample one:


myMusic = new Sound();
myMusic.attachSound("audio1");
myMusicVolume = 100;
myMusic.setVolume(myMusicVolume);
myMusic.start(0, 1);
playing = true;

All 10 audio files which linkage are set well and I changed the code above from "audio1" to "audio10" in every scene.


The problem now is, after published, the BGM ("BGM_Loop.swf") is playing very well, but the audio ("audios.swf") is not started at all.

If I played the "audios.swf" file individually, all 10 audio played very well, when it loads into this BASE.swf with the "BGM_Loop.swf movie, the 10 audio stopped.

Apparently there is a LEVEL issue which is similar to the "_root." concept in Kenny Bellew's tutorial, but I just can't figure out how.



If anybody has any idea, really appreciate!

Sound.start Doesn't Work
Hello all, and thank you kindly in advance for assistance. I have run into a problem that is stumping me. I've created a simple control to stop and start an MP3 file. I've created the sound object, and set it to true, so it plays when the movie starts. Great! The stop button even works. But then, I try to restart my Mp3 with the start button on my interface and.. ((sigh)). No love.

I have my start and stop buttons on their own layers. I've used the
following actionscript on my play button, and just don't know what I am missing??!?!?!?!

on (press) {
traxSample.start(0,0);
}


Arrf! Anyone know what the hey is up?

Once again, muchas gracias!

Monica

Sound Wont Start After Preloading
Hi I haver this code to load a song on a button(name stored in songInput)
Code:

myInputSound.loadSound(songInput,false);
//then a preloader loop is called
Loader_mc.gotoAndPlay("loader");
in the preloader I have
Code:
myInputSoundBytesTotal =_parent.myInputSound.getBytesTotal();
myInputSoundBytesLoaded=_parent.myInputSound.getBytesLoaded();

if (_parent.preloadNow==1 && myInputSoundBytesLoaded>0) {
myInputSoundLoading=Math.round((myInputSoundBytesLoaded/myInputSoundBytesTotal)*100);
if (myInputSoundLoading==100) {
_parent.playing=true;
_parent.paused=false;
_parent.stopped=false;
_parent.myInputSound.start(0,0)
_parent.preloadNow=0;
gotoAndStop("loaded");
}
_parent.percentLoadedText=myInputSoundLoading+"%";
problem is the song preloads perfectly, percentage displays, duration appears when loaded, position shows 0, but song does not start playing. If I click the play button again it starts.
I want it to start as soon as it finishes preloading.

I have noticed that if you visit the site again after you have already preloaded the songs and select one they will start immediately.
They also start immediately when testing locally.

any ideas?
mark

Start And Stop Sound Button
http://www.flashkit.com/movies/Basic...dex.php?chk=no
I want to learn how to make a button to start sound or stop sound, however, i were unable to download .fla from the link above, can you show me how to make it? Please and thanks!

Start/stop Sound With Button
I want there to be sound when my site opens. I can get the sound to play automatically and have added a button into the site if the user doesn't want to have sound. However, I am missing a detail or two and can't get it to start again after you've stopped it when you hit the same button. Does anyone have any suggestions?

Streamed Sound Start Position?
Hi,

Does anyone know how to determine when a streamed sound loaded into a sound object begins to play? I know the buffer time can be different for each mp3, but it seems like there should be a way of telling when the sound actually starts to play. Any suggestions?

Thanks
NTD

Copyright © 2005-08 www.BigResource.com, All rights reserved