Wednesday, March 25, 2009

Loading and controlling external SWFs

















1) KARAOKE SWF
This week we will be loading the Karaoke swf into another swf for playback.
A mask will also be used to set the karaoke swf into a TV set.

Some useful scripts:
/********** LOAD SWF VIDEO MOVIE *********/
//LOAD MOVIE BUTTON
on (release) {
// loads movie into the placeHolder_mc
loadMovie("KaraokeVideo.swf", placeHolder_mc);
}

The following script loads into the root.
/* NOTE REGARDING USE OF _root
on (release) {
// loads movie into the root,(on top of everything )
_root.loadMovie("karaoke.swf", _root.placeHolder_mc);
} */

//PLAY BUTTON
/* PLAY SWF */
on (release) {
_root.placeHolder_mc.play();
}

//PAUSE BUTTON
/* STOP SWF */
on (release) {
_root.placeHolder_mc.stop();
}


2) AUDIO ONLY SWF
We will also design and load an audio only SWF file into another SWF,
and create play and pause controls.

Some useful scripts:
/****** FRAME SCRIPT LOAD AUDIO MOVIE *****/
loadMovie("AudioOnly.swf","AudioOnly_mc");
/*----------------------------------------*/

/****** PLAY AUDIO BUTTON *****/
on (release) {
_root.AudioOnly_mc.play();
}
/*----------------------------*/

/****** STOP AUDIO BUTTON *****/
on (release) {
_root.AudioOnly_mc.stop();
}
/*----------------------------*/

No comments: