The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 4 of 4

Thread: how to instantiate sound from shared library?

  1. #1

    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.

  2. #2

  3. #3
    Thank you, Creatify!

  4. #4
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012