1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
var monClip:MovieClip = new MovieClip(); //construction
var chargeur:Loader = new Loader(); //Création de l'outil de chargement
chargeur.load(new URLRequest("AnimCS3.swf")); //Chargement du SWF depuis l'URL spécifié dans swfFile
monClip.addChild(chargeur); //affichage du SWF chargé dans le movieClip conteneur
chargeur.contentLoaderInfo.addEventListener(Event.COMPLETE, OnFichierCharge);
function OnFichierCharge(loadEvent:Event){
monClip = MovieClip(loadEvent.currentTarget.content);
currentSWF.addChild(monClip); //Lorsque le SWF est chargé, j'affiche dans le clip "currentSWF"
}
//bouton Pause :
btnPause.addEventListener(MouseEvent.MOUSE_DOWN, pauseVideo);
function pauseVideo(event:MouseEvent):void {
monClip.stop();
trace("Pause Video");
}
//bouton Play :
btnPlay.addEventListener(MouseEvent.MOUSE_DOWN, playVideo);
function playVideo(event:MouseEvent):void {
monClip.play();
trace("Lecture Video");
} |
Partager