Welcome to WebmasterWorld Guest from 54.234.8.146

Forum Moderators: open

Message Too Old, No Replies

audio file not working after export

     

kallekalle

2:56 pm on Sep 5, 2009 (gmt 0)

5+ Year Member



Hi all

Im pretty new to flash, and I have some problems with the audio.
I have a movie which I want to load embedded in html. So far no problems. However - my movie contains an audio file (mp3) and a play/pause function.

It all works nicely in the preview function, but when the movie is exported and uploaded, the audio doesnt play.

The play/pause button works perfectly and all, but the sound is gone.

Can anyone help me with this problem?

Thanks in advance.

rocknbil

4:55 pm on Sep 5, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome aboard kallekalle, how are you implementing the sound in the Flash? Is it loaded externally or truly embedded?

If it's loaded externally, then you need to upload the .mpg with the .swf. This is an example:

var snd:Sound = new Sound();
snd.loadSound("path-to/sound-file.mpg");

Otherwise, in the local directory where you developed this, look at the files there. Did you use "canned" methods form Flash? If so, there may be additional .swf or class files that need to be uploaded with it.

kallekalle

6:23 pm on Sep 5, 2009 (gmt 0)

5+ Year Member



It should be embedded. I use a flash compatible program called SwishMax.

There is only 1 main movieclip which contains this action script:

onFrame (2) {
mySound=new Sound();
mySound.loadSound("sound.mp3");
mySound.start(0, 5);
}

onFrame (3) {
stop();
}

onFrame (4) {
setLabel("pause");
mySoundPosition=_root.mySound.position/1000;
mySound.stop();
}

onFrame (5) {
stop();
}

onFrame (6) {
setLabel("play");
mySound.start(mySoundPosition,0);
}

Then I have added 2 images which works as pause/play buttons.

It all works great in the preview, and I have tried to look at the export settings, but I cant find any thing missing :-(.

I dont know if its relevant, but the buttons have these action scripts:

Pause:

on (press) {
gotoAndPlay("pause");
}

Play:

on (press) {
gotoAndPlay("play");
}

kallekalle

6:32 pm on Sep 5, 2009 (gmt 0)

5+ Year Member



sorry. Its not a movieclip. Its a scene (I told u I was new :-)).
So the SWF file only contains a scene and 2 images

rocknbil

6:54 pm on Sep 5, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



mySound.loadSound("sound.mp3");

This may or may not be embedded, if not it's a good thing.

If the file "sound.mp3" does not appear in the library, it should try to load it externally. This is Flash importing an external file, "sound.mp3." Upload sound.mp3 to the same directory as the .swf . . see what happens.

But if it's showing up in the project library, not sure what to say . . . maybe try a standard .mpg format? Not sure, if it's embedded and works locally, it should work when uploaded. I'm betting on externally imported.

kallekalle

7:03 pm on Sep 5, 2009 (gmt 0)

5+ Year Member



The file is in the library, and I have also uploaded the file to the same directory as the SWF file, on my server.

The action script will only work with mp3 file formats for some reason. I've tried to use a WAV format which didn't work.

Could it be beacuse I have no movieclips or something like that?

rocknbil

7:10 pm on Sep 5, 2009 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Bump to the next thread over [webmasterworld.com] and see if the sample code there helps. I really don't know what's wrong but you might be able to simplify things.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month