Sound Controller 1

SOUND CONTROLLER This class well help you to create many of SFX and control them easily.

Sound Controller 1

SOUND CONTROLLER This class well help you to create many of SFX and control them easily.In this class you can 1- mute and un mute the sound 2- set sound level by click on slider3- transform sound by make tween to sound Example: FOR ADD NEW SOUND FOR THIS CLASS DO THE FOLLOWING 1- DECLARE NEW SOUND VARIABLE IN PRIVATE PART, EXAMPLE ' PRIVATE VAR NEWSOUND:SOUND=NEW SOUND(); ' 2- DECLARE NEW SOUND CHANNEL FOR THIS SOUND , EXAMPLE ' PRIVATE VAR NEWSOUNDCHANNEL:SOUNDCHANNEL=NEW SOUNDCHANNEL(); 3- GO TO LOADSOUNDS() METHOD, AND LOAD THE SOUND FROM SOUNDS FILE (BINSOUNDS) 4- ADD THE FOLLOWING IN METHOD ' // THIS FOR LOAD NEW SOUND FROM SOUND FOLDER NEWSOUND.LOAD(NEW URLREQUEST( 'SOUNDS/NEWSOUND.MP3' )); // EVENT HANDLER TO CHECK IF THE SOUND IS LOADED OR NOT NEWSOUND.ADDEVENTLISTENER(EVENT.COMPLETE, COMPLETELOADNEWSOUND); // ERROR HANDLER TO CHECK IF THERE IS AN ERROR IN FILE OR NOT NEWSOUND.ADDEVENTLISTENER(IOERROREVENT.IO_ERROR, ERROR); ' 5- TO PLAY THIS SOUND YOU MUST ADD PUBLIC METHOD TO CALL THIS SOUND DO THE FOLLOWING ' PUBLIC FUNTION PLAYNEWSOUND():VOID { TRACE('PLAY') // SET TRANSFORM TO SOUND TO LET ALL SOUNDS PLAY IN SAME LEVEL OF VALUE VAR TRANSFORM:SOUNDTRANSFORM = NEW SOUNDTRANSFORM(SOUNDVALUE); NEWSOUNDCHANNEL.SOUNDTRANSFORM = TRANSFORM; NEWSOUNDCHANNEL = NEWSOUND.PLAY(0, 0, TRANSFORM); // ADD EVENT TO ALLOW BACKGROUND LOOPING }' 6- TO ADD SOUND TO TRANSFORM FUNCTION, GO TO SETSOUNDVALUETOALL(), AND ADD THIS LINE ' TWEENER.ADDTWEEN(NEWSOUNDCHANNEL , { _SOUND_VOLUME: SOUNDVALUE, TIME: 1, TRANSITION:"LINEAR" } ); '

   



Top Software

New Software

Top Search

Latest Reviews