开发者

HOw to play sound from swf library in javascript

开发者 https://www.devze.com 2023-02-20 20:34 出处:网络
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 c

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="i开发者_JAVA技巧ncoming.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!


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

0

精彩评论

暂无评论...
验证码 换一张
取 消