Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 4 of 4

Thread: how to instantiate sound from shared library?

  1. #1

    how to instantiate sound from shared library?

    Helloooo.

    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();
    mySound.play();

    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 kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012