开发者

Controlling an embeded SWF movie(audio/sound) file in flex

So I'm trying to get sound on my flex application. Then tried to load an swf movie with only audio in it. But when it loads on init(), it loops non-stop. Here's a sample code:

        [Embed(source="assets/alert03.swf")]
        private var alert01Swf:Class;
        private var alert01Loader:MovieClip;

        private function init():void {
            alert01Loader = MovieClip(new alert01Swf());
            alert01Loader.stop();
            alert01Loader.gotoAndStop(0, null);
            //this.addChild(alert01Loader);
        }

It just goes beserk! And I can't stop it. I tried using OGG but it was just to slow in loading. Mp3 is no good because it just isn't free. Any suggestions on using audio in Flex would al开发者_如何学Goso be great!


stop() and gotoAndStop functions control the frame navigation - do you have appropriate functions defined in those frames?

Define stopAudio/playAudio functions in the alert03.swf's document class and call them from the main SWF.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜