PDA

View Full Version : Clearly I'm activating sound files incorrectly.



Aaron Burgess
May 8th, 2002, 10:35 PM
I did this e-card, and it seemed fine. Then I played it on another persons computer (both PC), and the sound failed to work. I'm using Flash 5. Other e-cards with sound produced by other people worked fine. So here's my code.

On the first frame (root) I have:

s = new Sound();
s.attachSound("first");
s.start(0, 100);

Further down the timeline I change the music, and so I have:

s.stop(["first"]);
s.attachSound("second");
s.start(0, 100);

With the linkage in the Library I have it as Export this symbol. So it's saved out in the swf file.

So after that I just made a quick swf with the sound file dropped straight onto the first frame so it runs without calling it up in action script, anf that worked.

What am I doing wrong?

kitiara30
May 9th, 2002, 03:16 AM
Is to create movie clips containing the sounds, then activate them as and when I want them to play, with tellTargets and suchlike.

This is probably one of the more roundabout ways of doing it, and I'm sure there are far simpler methods, but this has always seemed to work for me.

upuaut8
May 9th, 2002, 04:46 AM
Your method is actually quite reasonable Kitiara... I see the advantages to creating a sound object as he's doing.. but it's so confusing that sometimes the more simple method like yours is the better solution.. at least until you've got an idea what your doing with those sound objects.

btw, Welcome to Kirupa Kitiara (see.. see, I really do welcome other people too.. )

kitiara30
May 9th, 2002, 05:41 AM
It's lovely to be here, you're a wonderful audience. No, really, give yourself a round of applause.

As for the sound problem, I had to write a childrens' game thing (note v. technical explanation there) that had a lot of sounds on rollovers and the like, and I found they all kept over-lapping. Putting them all in movie clips was the best way of getting round it at the time. I know you can use instances and so forth, but I guess now I'm just too set in my ways. [:) ]

Aaron Burgess
May 9th, 2002, 06:17 PM
Okay, clip it is then. Makes sense, and I can't figure out why the actionscript version doesn't work on some other peoples computers.

Thanks fellow-flashers.