Can I Create A Playlist Using LoadSound?
How can I create a playlist if I want to use the loadSound method?
I've place this code inside a blank MC:
onClipEvent(load) {
songArray = ["http://asp.inexo.com:84/Sounds/Boyd2.mp3", "http://asp.inexo.com:84/Sounds/Boyd1.mp3", "http://asp.inexo.com:84/Sounds/Boyd3.mp3", true];
index = 0;
thisSound = new Sound(this);
thisSound.setVolume (50);
thisSound = play()
}
onClipEvent(enterFrame) {
percentPlayed = thisSound.position / thisSound.duration;
if (percentPlayed == 1.0) {
index = (index < songArray.length - 1) ? index + 1 : 0; // if the end of the array has been reached play the first sound again
thisSound.loadSound(songArray[index]);
thisSound.start();
}
}
But the sound doesn't start!!!!
Thanks...
FlashKit > Flash Help > Flash General Help
Posted on: 08-05-2003, 01:19 AM
View Complete Forum Thread with Replies
Sponsored Links:
Tutorial To Create Mp3 Player Without Xml Playlist
I have browsed the web for a flash mp3 player but all I have found either play just one file per player or use a playlist generated from an xml file.
I can`t use an xml file as the mp3's will be called from a database, does anyone know of an mp3 player that can call the mp3's from a database or know of any tutorials that will help me make something?
btw I am a complete flash newbie
thanks
View Replies !
View Related
Help - Trying To Create Mp3 Player With Listbox As Playlist
Hi
Okay, what I'm trying to create is an MP3 Player (play/pause, next, previous, volume control) with a Playlist that's in the form of a Listbox. What I also want is a comment box and a picture (text and picture external) that relates to the sound from each track. So that when the user clicks on a different track in the playlist OR clicks the next or previous buttons, the picture and comment will change to the ones relating to the next track being played.
Now, I have looked at Lee's tutorial on how to make a MP3 Player and also his XML Video tutorial and they both contain explanations I want for the MP3 Player I have in mind. So I'm trying to merge the knowledge of both tutorials. The thing is, I'm having a hard time trying to imagine how this will be structured. What code will I need to change? What exact code do I need to use? What tutorial should I adapt on?
I've made an XML file containing only the url's and the desc's of two songs. So far, all I have in my flash document is 2 layers, actions and songList. The songList layer contains a listbox with the instance of "songList". The actions layer has this coding:
Code:
var slist:XML = new XML();
slist.ignoreWhite = true;
slist.onLoad = function(){
var songs:Array = this.firstChild.childNodes;
for(i=0;i<songs.length;i++){
songList.addItem(songs[i].attributes.desc,songs[i].attributes.url);
}
ns.play(songList.getItemAt(0).data);
songList.selectedIndex = 0;
}
var sonList:Object = new Object();
sonList.change = function(){
ns.play(songList.getItemAt(videoList.selectedIndex).data);
}
songList.addEventListener("change",sonList);
slist.load("songs.xml");
While my XML is this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<songs>
<song url="Track 1_q1_pet hates.mp3" desc="Steve Turner - Bad Breath"/>
<song url="Track 1_q2_tight people.mp3" desc="Steve Turner - Tight People"/>
</songs>
The List works because it's bringing up the desc of then songs but the songs are not playing. I know I'm doing something wrong, but can anyone tell me EXACTLY how to go about this in SIMPLIFIED explanations in step-by-step bullet points as this way will help me understand a bit more (see the Introduce Yourself section and my post "Roche says Hello" for more details why).
If anyone can help me, you have a heart of gold thank you.
View Replies !
View Related
Loadsound?
Hi....how does the loadsound action work? I wanna make some mp3's streamable. I tried to type in a path for an mp3 file located on my server but nothing happens? I wanna have a bunch of mp3's accessable to the public. I know how to use the get Url actions but that downloads the whole song before starting to play! The loadsound is what i think i should use right? I know that its posible to load a new sound into a soundobject somehow? Someone suggested to do a loadmovie (swf) and have each mp3 embedded in it's own (swf)? but I really wanna use the loadsound since thats what it's there fore I think? Any help is highly appreciated!
View Replies !
View Related
LoadSound Bug
When using a streaming loaded sound with Flash my computer only plays it when I test publish the flash file and not on the internet... I have also tried listening to other site's streaming music and get nothing?
I have the latest version of the Flash Player (6 r65) and the MP3's are cahced on my machine... they just won't play?
Anyone had this problem?
View Replies !
View Related
Loadsound()
Frame 1:
mysound = new sound();
mysound.loadSound("World_Tr-Q-Music-7715_hifi.mp3",false);
if(mysound.getBytesLoaded() == mysound.getBytesTotal()) {
mysound.start(0,1000);
gotoAndPlay("Scene 2",1);
}
else {
gotoAndPlay(2);
}
Frame 2:
gotoAndPlay(1);
this is all in scene 1, scene 2 is the main movie...
every time i play that the movie stops responding... can anyone help?
example... http://systemor1.hopto.org/main.html
View Replies !
View Related
Loadsound
My goal was to make a flash version of winamp which would load a selected song from my webspace and play it with all the normal controls. now it works PERFECTLY when the songs and the swf are on my hard drive, yet the instant i upload them, it wont load the songs!
on (press) {
_root.music = new Sound();
location = "/music/" add _root.names[_root.i] add ".mp3";
_root.music.loadSound(location, false);
if (Number(_root.bufferd)>10) {
_root.music.start();
}
}
is the code i use to load the sounds. _root.names is an array of song names. this loads them from the /music/ folder on my hard drive but it wont work of the net :/
has anybody come accross this before? is there something im doing wrong?
Any help apreciated!
View Replies !
View Related
Loadsound ? ? ?
Hmm! Okay, I'm trying to pull a sound in from a folder called update. may main file sits outside this in the file structure. on a frame on the main timeline of my main movie i have
audio.loadSound(audio.mp3);
with a container mc on the main stage called audio, yet when i export and play, it doesn't work.. . any ideas?
View Replies !
View Related
Loadsound
Hello all,
Here's what I want to do. I want to stream an mp3 when the user opens my swf file. I'd like to have the option of chosing another song and maybe adjusting volume and pausing the song.
I'm an action script novice. Actually, I have no idea what I'm doing. I put this action on the first frame of the movie to start:
loadSound( "http://www.depthofzot.com/music/windowlicker.mp3", true)
It doesn't work. Can anybody help?
Thanks a lot,
Dustin
View Replies !
View Related
Please Help With LoadSound
Hello,
I'm trying to create a very simple sound player on my website. I just need play and stop buttons and 1 mp3 to load itself automatically and start playing.
Everything works fine, using the loadSound function, except the fact that my mp3 is played at twice its speed ! I don't understand why... It does the same with any mp3... no changes if I use streaming or event sound. Does the same locally and on the webserver.
Anyone has an idea ?
Thanks !
View Replies !
View Related
LoadSound Other Than Mp3
Hi all,
I really need a solution to this. Can I use loadSound to play other than mp3 sound?
I've recorded a sound using java which then create a sound file (wav, aiff or au) and save it.
I need to play the saved sound file using loadSound in flash, but it didn't work.
Is there any way flash can play these type of external sound file?
Thank you in advanced.
View Replies !
View Related
Loadsound Again..
hi..
need some help on loadsound...i searched for the same, but did not found helpful.
i want preloader for multiple mp3. in my project some files(swf) have 4-6 sound loop. i want to load all mp3 with main preloader, and play only when respective button press.
View Replies !
View Related
LoadSound
I'm having some problems with loadSound in that no sound is loading. I am trying to stream an mp3. Trace functions show that the sound is not loading. I am loading the sound into a MC.
On first frame:
code: var sound_loaded = soundLoader.getBytesLoaded();
var sound_total = soundLoader.getBytesTotal();
var sound_percent = Math.ceil((sound_loaded/sound_total)*100);
onEnterFrame = function(){
this.loadBar._width = (sound_percent/2);
percent.text=(soundLoader.duration);
//duration comes back undefined even after play button is pressed.
}
On play button:
code: on(press) {
soundLoader.loadSound("http://www.theautumnrun.com/joer.mp3", true);
}
soundLoader is a MC
Fla is attached in MX 2004 format.
View Replies !
View Related
LoadSound
Hi,
I want to load an mp3 externally, make it stream, but I don't wanna play it right away. The mp3 loads fine, but offline I can hear the first second playing, and when I put it online it starts playing all the way after a bit has been loaded
Code:
coolTune = new Sound (soundLoader);
coolTune.onLoad = function (success:Boolean) {
if (success) {
coolTune.stop ();
}
};
coolTune.loadSound ("music.mp3", true);
Code:
mcPlay.onPress = function () {
coolTune.setVolume (60);
coolTune.start ();
};
I tried several codes, with setVolume too, but how can I load it, not hear it , and only hear it when I click the playbutton?
thanks,
Jerryj.
View Replies !
View Related
LoadSound
Hi,
I want to load an mp3 externally, make it stream, but I don't wanna play it right away. The mp3 loads fine, but offline I can hear the first second playing, and when I put it online it starts playing all the way after a bit has been loaded
Code:
coolTune = new Sound (soundLoader);
coolTune.onLoad = function (success:Boolean) {
if (success) {
coolTune.stop ();
}
};
coolTune.loadSound ("music.mp3", true);
Code:
mcPlay.onPress = function () {
coolTune.setVolume (60);
coolTune.start ();
};
I tried several codes, with setVolume too, but how can I load it, not hear it , and only hear it when I click the playbutton?
thanks,
Jerryj.
View Replies !
View Related
Loadsound()
can anyone explain why this url
http://www.musicwebtown.com/9608ssp/playlists/63873/501373.mp3
Doesn't load the mp3 in flash via Internet Explorer or a debug SWF, but will load just fine in FireFox????
also the url works fine directly in IE, just not flash.
Edited: 09/02/2007 at 01:26:55 PM by acridcola
View Replies !
View Related
LoadSound
Hello,
I am wondering if anyone out there can help me!!! I'm in desperate need of a fix for a sound problem i have. I know how to fix this problem if i import the sound into the flash file. But i cant do this with this example because the sound file is too large!!
I have some sound files dynamically loaded into my flash file using the loadSound("",false) command.
However i can't get the tracks to pause or fastforward or rewind. Does anyone have any idea how i can do this?? Is there a function out there somewhere that will help me, normally i just speed up the frame rate or reduce for the fastforward/rewind button, but i cant do this in this case as the sound is an external mp3 file :|
Please help, i'm desperate!!???
Many thanks
View Replies !
View Related
LoadSound()
can anyone explain why this url
http://www.musicwebtown.com/9608ssp/playlists/63873/501373.mp3
Doesn't not load the mp3 in internet explorer or debug SWF, but will load just fine in firefox????
View Replies !
View Related
LoadSound With Wav?
Hey guys, I haven't made a topic in a while.
Though, this is more of a query, does loadSound work with .wav because whenever I load them, they don't work, but mp3s work a charm. and what ARE the supported types?
View Replies !
View Related
Help With LoadSound
i have the next code which is working fine:
Code:
mysound.loadSound("music/m1".mp3", true);
i need to know when the sound finished playing?
how can i know?
(i want another clip to stop when the music stops)
View Replies !
View Related
LoadSound
Hi,
I want to load an mp3 externally, make it stream, but I don't wanna play it right away. The mp3 loads fine, but offline I can hear the first second playing, and when I put it online it starts playing all the way after a bit has been loaded
Code:
coolTune = new Sound (soundLoader);
coolTune.onLoad = function (success:Boolean) {
if (success) {
coolTune.stop ();
}
};
coolTune.loadSound ("music.mp3", true);
Code:
mcPlay.onPress = function () {
coolTune.setVolume (60);
coolTune.start ();
};
I tried several codes, with setVolume too, but how can I load it, not hear it , and only hear it when I click the playbutton?
thanks,
Jerryj.
View Replies !
View Related
LoadSound
I'm having trouble loading an external mp3 file. I have the script below placed in the first frame. The mp3 file is in the same directory as the swf file. Can someone tell me what I'm doing wrong? Please help. Thanks
var my_sound:Sound = new Sound();
my_sound.loadSound("moonlight.mp3", true);
my_sound.onLoad = function(success) {
my_sound.start();
}
View Replies !
View Related
LoadSound()
Hi,
Im just wondering what the code is to load mp3s dynamicaly(or whatever its called)
i know its somthing like this
loadSound("url","isStreaming");
what what is the url, is that the url ofthe webpage, or the url of where the sound is in the folder (Eg: graphics/mysound.mp3)
thanks
giles
View Replies !
View Related
LoadSound?
I have tried to do a load sound to load a mp3 but all it keeps doing is as me where I want to download it to. I just do't understand why I am having such a difficult time I just want to have some loops play when they are need But the file size is too large for my main movie timeline,
when I try to link it from the library it cause my preloader to not work until the sound has loaded. When I try to load a swf withe the sound links it only works at level 0 which blanks out my screen obviously and when I try to load it to level 1 - No sound then. If I drop the sound onto the stage and try to loop it it sounds like garbage and has a skip berfore it starts again it just is not a nice smooth loop. When I had tested the load sound locally it worked fine but when I put it up to web it asks me where I want to save the file to not allowing me to control it. Wheew I'm lost and am going in circles with hopes of each idea being a solution only to get very fustrated every time.
View Replies !
View Related
LoadSound
When using loadSound with an .mp3 in the same directory as the fla, I am able to hear the .mp3 in the test movie of Flash. However, when I publish it to Dreamweaver, I can only hear the .mp3 if I additionally add the .mp3 to the root directory. If the .mp3 is not in both the fla's directory and the root directory, the .mp3 does not play in Dreamweaver or for that matter, the web. Also, if I bury the .mp3 just one folder deep in the fla's directory, the .mp3 does not play regardless, even though it plays in the test movie of the Flash environment.
View Replies !
View Related
Using LoadSound And Paths
I'm making a CD-ROM with SWF's in one folder, and the MP3 files in a subfolder called "sound". Hence:
[swffolder] - contains SWF's
+[sound] - contains MP3's
I'm using loadSound, but the path I'm specifying doesn't work:
mySound.loadSound("/sound/test.mp3", false);
Is there any way to specify the URL as a path to a relative subfolder, without having to specify the whole path starting at the root?
Thanks!
View Replies !
View Related
LoadSound Problem
Hi - can anyone tell me why I can't hear anything when I use this code please?
I can see the trace but there is no value for the amount of bytes loaded either - and yes 1.mp3 is in the right directory and it's 6k in size.
Thanx!
soundSpace = new Sound(_root.wordSound);
soundSpace.loadSound("1.mp3",false);
soundSpace.onLoad = doSound();
function doSound (){
var bite = soundSpace.getBytesLoaded();
trace("bite:" + bite);
soundSpace.start();
}
View Replies !
View Related
LoadSound For An MP3 Stream
Hi - I have a script which loads an MP3 stream off a Shoutcast server that plays it fine when I run it in the Flash Player, but won't work at all in the browser. I have the latest version of the plugin.
Any ideas?
Thanks.
View Replies !
View Related
LoadSound And Start()
hi all i'm using the loadSound feature and i can load a streaming sound (laodSound(file, true)....now i can't use the start function to set an offset , trying to have a forward or backward...any suggestions about it ?
tnk u all in advance, mitch
View Replies !
View Related
LoadSound And Framerate ?
Hey everybody, heres a fun one. I have a loadSound function that works great on a IE6 PC. If I run it on a IE 5.1 MAC it doesn't work properly. On a PC the sound loads, the volume gets set to 0 and the sound stops.
On a MAC, every sound I have in the movie(event and streaming) get stopped. The only sounds that play are sound inside of buttons.
Basically what is suppose to happen is, after the intro plays the site loads up and plays the 1st song in the jukebox. My framerate is at 60fps. Could that be too fast for the function to work correctly on a MAC?
Heres the test link:
http://www.theanglephotography.com/index_test.html
function loadMusic() {
myMusic = new Sound();
myMusic.loadSound("track1.mp3", true);
myMusic.setVolume(0);
myMusic.stop();
}
Any ideas out there? I'm ready to pull my hair out with a friggin pair of pliers!
Thanks
View Replies !
View Related
Stop LoadSound
I'm loading sounds with:
mySound.loadSound(filename,true);
I'm currently creating these MCs that have the sound object and the file it's trying to load... each clip has it's own loading indicator exhibited as a bar that scales according to the percentage loaded...
If I click on another one of these movie clips I would like to stop any currently playing sounds and stop the buffering process of the loadSound... can I do this or will the full sound load once I call the loadSound?
Thanks in advance,
JH
View Replies !
View Related
LoadSound() Network URL
I need to loadSound from a Network URL.. I don't think this can be done...
example of a network url
\servername est est est.mp3
bgSound.loadSound("\servername est est est.mp3 ", true);
That failes it tries to find
file://mypath/\servername est est est.mp3 which obviously isn;t there...
I need it to look for \servername est est est.mp3 only
Then it will find the file...
Please help so I dont have to consider using PHP to move the file onto the same server as this would be sooo time consuming..
Thanks
Nathan
View Replies !
View Related
LoadSound Not Working
I'm trying to loadSound into my .swf! Everything works when I test the movie with the flash player, but I soon as I embed it into a page the sound doesn't play!
The sounds, the .swf, and the page are in the same folder on the server!
Frame 1:
thissound = new Sound();
thissound.loadSound ("http://asp.inexo.com:81/foundation/media/Boyd2.mp3", flase);
Frame 22:
thissound.start();
Thanks....
View Replies !
View Related
LoadMovie Vs. LoadSound
Ok, this may be a weird one.
Currently I'm working on having several audio tracks available in the projector, and everything works fine as it is. Right now I have my audio published as each track is in its own SWF which I load into MCs in the projector. This works fine also, except that the projector has to completely load each SWF before it can be accessed.
I can convert the projector over to load all the audio with the loadSound() command, but in doing so all the mp3s would have to be available to the projector, and I do not want any of the mp3s to be "public". This projector will be on a CD and I can put all the mp3s in a directory, but if you were to explore the CD the end user would have access to all the mp3s if I did it that way.
Do I need to go into each SWF and change the sound to streaming? Or does it even make a difference?
//currently, each SWF is set up this way
//sc1 is the MC on the stage to attach the sound to
//my_audio.wav is in the library and has been linked properly
demosnd1 = new Sound(sc1);
demosnd1.attachSound("my_audio.wav");
This SWF is published as demo.swf
In the projector:
//demomc is the MC to load the SWF into
_root.demomc.loadMovie("demo.swf");
Then to play the sound would be something like:
on(release){
_root.demomc.demosnd1.start(0,0);}
The way I have everything loading now works great except for the fact that everything acts like "event" sounds (and it slows the projector down when it is asked to load them). Is there a way to make the SWFs that get loaded act like "streaming" sounds?? (remember I am using the loadMovie command in this case)
I have read the whole tutorial from www.kennybellew.com, and there is alot of very useful info (alot of which I had already known or figured out). This particular question was not exactly covered, so I'm wondering if anyone else has had experience with this.
Thanks in advance.
View Replies !
View Related
LoadSound Is Not Working In PPC?
I am uploading mp3 file using the following code in the flash, which is working perfectly fine in desktop PC what not in PPC. Can anyone tell me is there anything wrong with the code? or PPC player?
ActionScript Flash:
soundObj = new Sound();
soundObj.loadSound("1.mp3",false);
soundObj.start();
plugin version is 6,0,81,0
Does preloader make any effect in playing sound when playing locally.
MP3 file is in the same directory where the swf file is.
When i embed the same mp3 file in the swf file it plays. But when i use the loadSound method it doesn't.
Thanks,
Vivek
View Replies !
View Related
A Loadsound Problem :/
Hi, I have been having some trouble with getting a loader to work right with loadsound. I have read and re-read many tutorials on the site, as well as searched the forums for some answers, but I haven't found anything that is helping me, may also be because i'm not very good at actionscript yet. Anyways figured I would ask for some help, first off i'm using flash mx 6.0, the flash I have made contains a simple preloader on one scene which waits until all frames are loaded before proceeding, this one works perfectly. on the scene which contains the actual animations etc.. it is just an audio player. what I am trying to have it do is after the user clicks on the Play button it will fade out then the text "loading" will fade in and will then load an external mp3, once finished it will fade out and the song will play, along with an animation in the background. This is where my problem is.. I think. I say I think because the flash "seems" to work for me, but then I think it does so since I already have the mp3 file. Here is the actionscript I have tried which seems to semi-work:
code: stop();
myTune.loadSound("tune.mp3");
myTuneBytesTotal = _root.myTune.getBytesTotal()
myTuneBytesLoaded = _root.myTune.getBytesLoaded()
if (myTuneBytesLoaded = myTuneBytesTotal) {
myTune.start()
gotoAndPlay(17);
} else {
play();
}
what I am trying to have it do is on frame 15 it will stop then determine if the bytesloaded equals the bytestotal, if it does it will skip to and play frame 17, however if it doesn't it will continue to play to frame 16 which contains a gottoandstop to frame 15 to loop it until it finishes loading the mp3. I have uploaded the flash to my ftp space, when I visit the url, when I first hit the play button it went to the loader, then went into the animation, and no audio was played. However when playing through it a second time it went to the loader played the audio and played the animation. Others have tried to use it, but they all tell me it doesn't load the audio or animation. Sorry for blabbing so much, but any help is much appreciated.
edit: Oops forgot to add a url to the flash using the above actionscript: link
-B.B.
View Replies !
View Related
MySound.loadSound()
Is there a way to delay the playing of an mp3 file being loaded using the loadSound()?
here is part of my code:
_global.goAudio = function() {
mySound = new Sound();
//static value to set volume. will come from session setup page
mySound.setVolume(100);
mySound.loadSound(_global.fpath+_global.audFile, true);
mySound.onSoundComplete = nextAudio;
mySound.start();
};
onSoundComplete I'm calling another function that iterates over an array holding mp3 file names so as to play the next file in the array. They play just fine, but I want a bit of a delay before the play. Can anyone help?
Thank you,
View Replies !
View Related
LoadSound() Works In .fla But Not In .as
I've run across a problem loading mp3 files into a sound object. This code works when placed on the timeline directly:
Code:
trace("loading audio");
var s:Sound = new Sound();
s.onLoad = function(success) {
if (success) {
trace("got it");
} else {
trace("error");
}
};
s.loadSound("audio/Sulk.mp3",true);
Output window:
Code:
got it
The audio starts, everything is cool.. I can't build my app like this though, needs to be AS2. So, I make a simple class to do the above:
Class:
Code:
class AudioTest {
// prop
var s:Sound;
// const
function AudioTest() {
trace("birth: AudioTest");
loadAudio();
}
// loader method
public function loadAudio():Void {
trace("loading audio");
var s:Sound = new Sound();
s.onLoad = function(success) {
if (success) {
trace("got it");
} else {
trace("error");
}
};
s.loadSound("audio/Sulk.mp3",true);
}
}
FLA:
Code:
var pleasework:AudioTest = new AudioTest();
Output window:
Code:
birth: AudioTest
loading audio
I get nothing else. Audio doesn't load, I don't even get a trace statement in the output from my onLoad function. Now here's the wierd thing: If I intentionally point the loader to a file that doesn't exist:
Code:
s.loadSound("nosuchfile.mp3",true);
I get this for output:
Code:
birth: AudioTest
loading audio
error
Error opening URL "file:///Macintosh%20HD/Users/aaron/Desktop/podcastplayer/Build/nosuchfile.mp3"
So it knows when it fails, but gives me nothing when I direct it to the correct path/file. So why can I load an mp3 into a sound object via code in the .fla, but not in a class? What gives!??
View Replies !
View Related
LoadSound On Mac Won't Play
I am using Flash MX 2004 Professional on a dual G5 Mac running OS X. I have tried loadSound with several mp3 files and it refuses to play. Whether I used loadSound("x.mp3",true) or loadSound("x.mp3",false) it simply will not play. I have controls to stop and start the sound, and I use onLoad and onID3 to display information regarding the load. It appears the file loads successfully (both locally and from a web server)...but the music...simply...will...not...play. If I replace loadSound with attachSound to play an embedded file, it works fine.
What could possibly be wrong?
View Replies !
View Related
Using LoadSound (how Much Has Loaded)
I have a bunch of sounds I am loading at the beginning of a flash movie, looking something like this:
stop();
// create a new Sound object
var my_sound:Sound = new Sound();
var sound1:Sound = new Sound();
var sound2:Sound = new Sound();
var sound3:Sound = new Sound();
var sound4:Sound = new Sound();
var sound5:Sound = new Sound();
sound5.onLoad = function(success:Boolean) {
if (success) {
my_sound = sound5;
gotoAndPlay(2);
}
};
// load the sounds
sound1.loadSound("sound1.mp3", false);
sound2.loadSound("sound2.mp3", false);
sound3.loadSound("sound3.mp3", false);
sound4.loadSound("sound4.mp3", false);
sound5.loadSound("sound5.mp3", false);
Basically, what I plan to do with these sounds is switch between them as the user chooses an option from a combo box (its a little more complicated than that so I can't just load the sounds while compiling and have them published with the movie...also there's security reasons as well...).
What I want to know is, will the five commands at the end execute in order? That is, will the command "sound2.loadSound("sound2.mp3", false);" wait until the command "sound1.loadSound("sound1.mp3", false);" is done before it loads, so that my movie will only go to frame 2 when ALL the sounds are loaded?
My second questions is, is there any way I can determine how much of each sound has loaded, so that I can tell the user the percentage of data that has loaded, rather than just a simple "Loading Sounds...Please Wait"?
thnx
View Replies !
View Related
Synchronization Using LoadSound()
Alright, I seem to have worked myself in to a bad, bad situation here.
I made about a 30 minute combined video/audio demo for a website. The audio came to me in only a few pieces and we have no audio editing equipment here, nor were we willing to purchase any. So, what I did was let Flash stop and start an audio file according to where it was on the timeline.
Being a programmer and not a designer (dont ask me why I was put to work on this, I'm not too happy about it) I lacked the foresight on what Flash can and cannot do. So, while I now know how I should have done it, that is of no use to me. It's due, now, and I need to know if there's any way to salvage what I have or if I'm going to be here until 4am making it right.
What I did:
I originally had everything timelined out so that I could import the sound file and drag a few frames here and there to sync it up and be done with it. However, it turned out that the sound in no way matched the script I was given in order to build the video. (I was making the video while the actor was in the sound studio). So, I just started over.
I wrote a function (something programmers are supposed to do) that pauses the timeline x-seconds at a time so that if something came up, I wouldn't have to play the keyframe dragging game again. I also didn't import the .mp3 file because it is also possible that they may want to listen to the tutorial and not see it. Having the .mp3 imported into the .exe/.swf and also local on the disk took up too much space, so I decided to kill two birds with one stone and use loadSound, setting the isStreaming property to "true" so that synchronization can be obtained (it is my understanding that Flash will drop frames as needed in order to match the sound)
I also had to do some stopping/starting at specific locations to edit out some words, etc. 3 weeks into the project and I get the files on the CD. Synchronization is lost. Why, and how can I fix this QUICKLY. I know I can brute force it, but that's something I would have had to start 3 weeks ago in order to meet a deadline.
I need a way to guarntee accuracy on different machines using loadSound with streaming set to true, while being able to start and stop at specific locations.
View Replies !
View Related
LoadSound LOADING
Hi everone
I'm using loadSound to load an external mp3. This works fine, but:
I am aware of, that to play this mp3, flash needs to load the 5 first seconds before playing (I think 5 is the default value, how do I change this by the way). I wold like to let the viewer know, that Flash is loading. What would be the cleverest way to do this?
Hope you have a sugestion,
Lars
View Replies !
View Related
LoadSound Problem
Hi, I am new to flash actionscript.
Is there a way for me to the load the sound in onEnterFrame?
e.g. onEnterFrame = function(){
if(gameEnded){
sound.loadSound("clapping.mp3",1);
}
}
I try to use codes that is similar to this example but the sound did not appear at all. Does anyone know how to solve the problem? Please help
View Replies !
View Related
[F8] Kill LoadSound
Hi,
I am creating an mp3 player which loads and plays mp3s dynamically. When you select an mp3 to loadSound() is invoked to load and play it. Problems seem to arise when selecting a new mp3 before the current one has finished loading ie it I can't seem to completely stop a loadSound once its started (I've even tried placing the sound in a movieclip and deleting it with no success).
The code I'm running each time an mp3 is selected is:
//kill off current sound
music.stop();
stopAllSounds();
//load new sound
music=new Sound();
music.loadSound(mp3, true);
music.start(0,1);
If anyone knows a good way of stopping the current load sound please let me know
Thanks
Robin.
View Replies !
View Related
[F8] LoadSound Problem
I'm creating a flash mp3 player that loads a playlist and plays the songs. The listing works fine, and it goes to the next song when the current song completes, but I noticed that it stops the song half way through and restarts it. It then plays through perfectly and goes on to the next. If anyone can help me out with this, It would be much appreciated.
Test it and see if you get the same results:
my mp3 player
Here's the code I'm using to play the songs:
Code:
_global.nextSong =function () {
snd.stop();
var p = _root.playlist;
if (p.selectedIndex == p.length - 1) { p.selectedIndex = 0; }
else { p.selectedIndex = p.selectedIndex + 1; }
playSong(displayUpd(p.selectedIndex));
}
_global.playSong=function (song) {
_global.snd = new Sound();
snd.onLoad = function (success:Boolean) {
if (success) {
snd.start();
snd.onSoundComplete = function () { nextSong(); }
}
else {
trace('ERROR: Unable to load song');
nextSong();
}
}
snd.loadSound(song, true);
}
View Replies !
View Related
[CS3] Problem With LoadSound
I would like to simply stream an mp3. I have found a bunch of tutorials that all say the same thing:
mySound = new Sound();
mySound.loadSound("song1.mp3", true);
mySound.start(0, 5);
But I dont hear a thing. I have even tried uploading the files and I still dont hear anything. What am I missing? thanks
Dan
View Replies !
View Related
Use Of Variable With LoadSound
coolTune = new Sound (_root.soundLoader);
coolTune.loadSound("sound1.mp3", true);
coolTune.start(0,1);
The above script works fine but if I use a variable instead ie:
coolTune = new Sound (_root.soundLoader);
coolTune.loadSound(soundvar, true);
coolTune.start(0,1);
wherein soundvar is the variable (input is taken from the user for soundvar), the script doesnot work. Please help.
View Replies !
View Related
|