Topic: flaxh mx prob Pages that link to <a href="https://ozoneasylum.com/backlink?for=11341" title="Pages that link to Topic: flaxh mx prob" rel="nofollow" >Topic: flaxh mx prob\

 
Author Thread
me~
Bipolar (III) Inmate

From: Detroit, MI
Insane since: Jun 2002

IP logged posted posted 06-28-2002 06:50 Edit Quote

in flash mx, there is a new function called loadSound, which basiclly plays a sound.
syntax: instance.loadSound(song name, stream);

I created the following code:
randomSound = new Array();
randomSound[0] = "first song";
randomSound[1] = "second song";
randomSound[2] = "third song";
randomSound[3] = "fourth song";
randomSound[4] = "fifth song";
num = Math.round(Math.random()*5);
cool = new Sound();
cool.loadSound(randomSound[num]+".mp3", true);

this randomly chooses a song and plays it when the swf is opened and works great. However,

loadVariables("playlist.txt", "");
soundToPlay = new Sound();
soundToPlay.loadSound(song1, true);

playList.txt: &song1=set it off.mp3&

This works only if soundToPlay.loadSound(song1, true); is activated by n event like on(release). So what I am asjking is why the array swf plays, but the player cannot load inthe playlist and play the songs, and is there any way to fix this. I hope this make sense, thanks for yourthelp.

GRUMBLE
Paranoid (IV) Mad Scientist

From: Omicron Persei 8
Insane since: Oct 2000

IP logged posted posted 07-01-2002 11:18 Edit Quote

just a guess: maybe its the whitespace in your songtitle: set it off.mp3
try renaming it into: set_it_off.mp3 or so.
but thats probably not it.

Steve
Maniac (V) Inmate

From: Boston, MA, USA
Insane since: Apr 2000

IP logged posted posted 07-01-2002 22:31 Edit Quote

I guess I AM confused by this. How do you figure the variable is going to get loaded if not by an event such as entering a key frame or an on(release)? The random item example requires an event to trigger it - loading the swf. And it doesn't repeat until the event repeats - next time that swf is loaded it plays again - a random selection.

With the second example, once the variable has been loaded, some event has to occur to change the value of the variable. Right?

Or did I misunderstand completely?

quatroGringo
Nervous Wreck (II) Inmate

From: Minneapolis, MN, USA
Insane since: Apr 2002

IP logged posted posted 07-02-2002 05:09 Edit Quote

Why not place an OnClipEvent on an empty movie clip, or call a funcion at the end of the song.

5G

UpInSmoke
Neurotic (0) Inmate
Newly admitted

From: detroit, mi
Insane since: Jul 2002

IP logged posted posted 07-02-2002 07:31 Edit Quote

Ive tried this, and I'd think it would work, but it doesnt, can someone point out what I'm doing wrong?

this.createEmptyMovieClip("music", 1);
with (music) {
loadVariables("playlist.txt", "");
soundToPlay = new Sound();
}
music.onLoad = function () {
soundToPlay.loadSound(song1, true);
};



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu