Skip navigation
Currently Being Moderated

Playing sound from externally loaded .swf

May 1, 2013 6:49 AM

Tags: #as3 #sound

I have a small .swf file that contains one of the characters in my game. In my main actionscript 3 project, I load the .swf from an external source and display it in my game. It works fine, however, I would also like the swf to contain a short sound clip that should be played whenever the character is clicked on.

 

I know I could add an onClick listener to the small .swf itself and write code in Flash Professional to play the sound. The problem is that I have an options menu in my game that allows the user to specify the volume of such sounds, and I believe such information would be unavailable to the externally loaded .swf

 

So the sound file needs to somehow be packaged inside the character .swf, but I also need to be able to play it through my custom 'SoundPlayer' class I have in my actionscript project. Any ideas how I could achieve this?

 
Replies
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    May 1, 2013 7:21 AM   in reply to RogerDorsey1

    create a public method in your external swf that controls the sounds volume.

     
    |
    Mark as:
  • kglad
    72,260 posts
    Jul 21, 2002
    Currently Being Moderated
    May 1, 2013 8:01 AM   in reply to RogerDorsey1

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points