homepage Welcome to WebmasterWorld Guest from 50.16.165.62
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

    
audio file not working after export
kallekalle




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

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




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

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




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

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




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

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




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

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




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

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




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

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved