0

i'm not a flash developer, so i don't know if this is possible, please clarify it if you can :)

My situaion: I have to play some sound on a webpage with javascript, and probably flash is the best choise, so i created an swf library with mi sounds wit swfmill: http://swfmill.org/

this is my code:

<?xml version="1.0" encoding="iso-8859-1" ?>    
<movie width="320" height="240" framerate="12">
  <background color="#ffffff"/>
  <frame>
        <library>
            <sound id="incoming" import="incoming.mp3" />
            <sound id="outgoing" import="outgoing.mp3" />
        </library>
    </frame>
</movie>

I converted it with swfmill and now i have my sound.swf library.

Is it possible to play a sound from this library in javascript? or i'm missing something? Can you please provide a valid alternative?

Thank you very much and sorry for my english!

Laphroaig
  • 619
  • 4
  • 12
  • 26

1 Answers1

0

Flash has a built in system to interact with javascript using the ExternalInterface class.

not completely read through this but it might guide you in the right direction

http://www.viget.com/inspire/bi-directional-actionscript-javascript-communication/

If you've downloaded a premade flashplayer, you might want to check their api to see if they allow this

EDIT: You will need an swf player for my post. However, it still shows javascript and flash interaction to get stuff you need. You can then use a swf media player or HTML 5 to play the audio

Jase
  • 599
  • 3
  • 9
  • I've seen the tutorial, but i don't know if i can do this with an xml file converted to swf. I do not have a flash IDE to write action script code. – Laphroaig Mar 29 '11 at 23:56
  • The library you downloaded may have already registered some callbacks. You'd need to check if they have. If so, javascript could retrieve the data. If they don't, there's not much you can do with javascript interaction as far as I know. – Jase Mar 30 '11 at 00:04