Forum Moderators: open
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.
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.
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");
}
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.
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?