Results 1 to 4 of 4
April 21st, 2011, 10:56 AM #153Registered User
how to instantiate sound from shared library?
I'm building a shared library of sounds, but am having trouble referencing them in code in the swf that needs them.
First I built the built the library and clicked 'export for runtime sharing'.
Second I built another swf, went to file > open external library, and dragged and dropped the sounds I need into the new library.
Third, I tried to reference it in as3 the way I would normally:
var mySound:mySoundClassName = mySoundClassName();
and I get two errors, a 1046 and an 1180.
So my question is: how does one instantiate a sound item from a shared library in AS3?
okay, so I have a hack that works: I created a movieclip in the swf that contains the imported sound. I can reference this movieclip as needed and it'll play the sound. But this seems sloppy and impractical considering how many sounds I need imported in this swf. So any help would be greatly appreciated.
Last edited by tugboat; April 21st, 2011 at 11:07 AM.
April 21st, 2011, 01:47 PM #2
April 21st, 2011, 01:52 PM #353Registered User
Thank you, Creatify!
May 2nd, 2011, 11:32 AM #453Registered User
A follow up to the sound library question:
The swf that I'm loading the sound library into has a loader on it. And there's a pretty big pause before the loader appears.
I don't have any assets exported for use in frame 1, so that isn't the explanation.
My question: Does the shared library have an impact on the speed at which a first frame loader appears? Is it just like you had a bunch of sound files exported for use in frame 1?
Is there any way to use a shared library without this issue?
Last edited by tugboat; May 2nd, 2011 at 11:42 AM. Reason: once again: me = the worst writer ever