all groups > macromedia flash sitedesign > march 2006 >
You're in the

macromedia flash sitedesign

group:

mp3 not playing after published .swf is refreshed


mp3 not playing after published .swf is refreshed d_angelo1
3/11/2006 12:00:00 AM
macromedia flash sitedesign:
Hello,

BASIC SCENARIO
I am working on an artist flash banner for a company and am stuck on an mp3
issue. http://www.zioneyemedia.com/test/sesac/artist banner 4.html (or
http://www.zioneyemedia.com/test/sesac/artist banner 4.html if the link doesn't
work). The mp3 plays when the movie plays, but after the movie is done and I
refresh the page, the mp3 no longer plays. I'm assuming it has something to do
with the volume control code or how the mp3 was imported...

ADVANCED SCENARIO:
Below is the code I created for the volume control, which is placed in the
first frame of the main timeline of my movie.

~ volume control ~
onClipEvent (load) {
mySound = new Sound();
mySound.loadSound("http://www.zioneyemedia.com/test/SESAC/controlcrop2.mp3",
false);
}
onClipEvent (enterFrame) {
downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
if (downloaded != total) {
_root.dl = "downloading song...";
} else {
complete = 1;
_root.dl = "";
}
mySound.setVolume(_root.volume);
}

I imported the mp3 sound through Import to Library > (right click on mp3) >
Linkage > Export for Actionscript and Export in First Frame.

ACTIONS:
I've tried messing around with the streaming boolean (true or false), and it
still doesn't play after being refreshed... I've worked on this too much and
can't stand the song anymore... Needing some fresh ears (and eyes) to look into
this.

RESULT:
So the mp3 works once, and I'm trying to figure out how to make the mp3 play
everytime the movie is refreshed, and at the same time, be able to have the
volume control clip to control the volume of the mp3.

HELP!!! I need to get this done by Monday, March 13!!!

Let me know if you guys have any methods that will work easier or better, or
both!
Attach Code

onClipEvent (load) {
mySound = new Sound();
mySound.loadSound("http://www.zioneyemedia.com/test/SESAC/controlcrop2.mp3",
false);
}
onClipEvent (enterFrame) {
downloaded = mySound.getBytesLoaded();
total = mySound.getBytesTotal();
if (downloaded != total) {
_root.dl = "downloading song...";
} else {
complete = 1;
_root.dl = "";
}
mySound.setVolume(_root.volume);
}
Re: mp3 not playing after published .swf is refreshed tralfaz
3/11/2006 1:11:28 PM
[quoted text, click to view]

Something is happening all over with Flash and sound problems. My
pages that used to work fine no longer play streaming audio after a
refresh, just like your page.
I am seeing many sound complaints lately. I removed Flash player 8
and went back to 7 but it's the same problem. I noticed that the
problem is not in Firefox..just IE6 so I suspect that it was caused by
a security update from Microsoft. I haven't sorted the problem out
yet but if I do I will let you know.
You can switch to event sound instead of streaming sound if you want
to keep the sound working temporarily.

You do have some code problems though. You are not deleting the
onEnterFrame after the load is complete and you are not ending the
dragging correctly..
stopDrag; should be stopDrag();

tralfaz

Re: mp3 not playing after published .swf is refreshed tralfaz
3/11/2006 6:22:33 PM

[quoted text, click to view]

I found that if I delay the loading of the streaming mp3 by just a
little longer that it works correctly. I don't know why but it works.
tralfaz

Re: mp3 not playing after published .swf is refreshed d_angelo1
3/12/2006 12:00:00 AM
Hey Tralfaz,
Thanks for the input! I have a few questions...

So how do you delay the loading of the mp3?
Were you able to refresh the page and still have the sound play (and have the
volume control still function)?
Did you have it as event sound or streaming?

Thanks! This is helping a lot and is giving me hope! :P
Re: mp3 not playing after published .swf is refreshed tralfaz
3/12/2006 1:58:23 AM

[quoted text, click to view]

I took a look at your file. It had some code errors in the volume
control movieclip but mainly the problem is that you have a preloader,
but it's only for the sound file. You also need a preloader for the
main file. Once the main file is loaded, then you can load the
streaming sound. You might not have to wait for the whole thing to
load before starting the streaming sound but it's safer to do that.

I had to use a decompiler to convert your swf file to a Flash 6 fla so
I could test it. I removed your code from movieclips and redid it my
preferred way.. with all the code at the root instead of being
attached to things in different places. I did it just for testing
purposes but you are welcome to look at it if you want to. Bare in
mind that the decompiler changes a few things like layer names and
object names.
http://www.kompanionkare.net/flash/artistBanner4.zip
(3 megs)

I don't usually give people back code that I decompiled and modified
but you seem to be frustrated with your project so I hope you don't
mind.
You would need to change the name of the sound file. I got sick of
that one to. :o)
One other suggestions.. don't use spaces in file names or links.
They turn into "%20"s in the browser, it looks ugly and the links
break when you post them.
tralfaz

Re: mp3 not playing after published .swf is refreshed d_angelo1
3/13/2006 5:35:48 AM
AddThis Social Bookmark Button