Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 83883

Re: Audio will not play with AS 3

$
0
0

you should have:

 

import flash.events.MouseEvent;

import flash.events.Event;

 

stop();

var myChannel:SoundChannel;

var mySound:Sound=new Sound();

 

listenMe();

prev_btn.visible=false;

next_btn.addEventListener(MouseEvent.CLICK, clickNext);

prev_btn.addEventListener(MouseEvent.CLICK, clickPrev);

 

function clickNext(e:MouseEvent):void {

nextFrame();

listenMe();

}

function clickPrev(e:MouseEvent):void {

prevFrame();

listenMe();

}

function listenMe():void {

var C:Class=Class(getDefinitionByName("Audio_"+this.currentFrame);

mySound=new C();

myChannel=mySound.play()

prev_btn.visible=next_btn.visible=true;

    if (currentFrame == 1) {

        prev_btn.visible = false;

    } else  if (currentFrame == totalFrames) {   

        next_btn.visible = false;

    }

}


Viewing all articles
Browse latest Browse all 83883

Trending Articles