# http://swftools.org compilateur swfc .flash name="visio3.swf" bbox=700x600 version=9 compress background=#556677 .font f2 "font/Vera.ttf" .box actif width=60 height=50 fill=black .edittext log color=blue width=460 height=425 multiline html .put log 0 0 .action: package { import flash.display.* import flash.text.* import flash.net.* import flash.events.* import flash.media.Sound public dynamic class Main extends MovieClip { var tab= new Array(); var image=new Loader(); var nbr:Number; var courante:Number=0; var lo1: URLLoader; var arr=new Array(); var txt:String; var file:String; var snd:Sound=new Sound(); function trace(s) { this.log.htmlText=s+"\n"; } function majImage () { // nom|larg|haut|taille|comment arr=tab[courante].split("|"); trace( (courante+1)+'/'+nbr+" -- "+arr[4]+" "+arr[1]+"x"+arr[2]); image.load(new URLRequest(arr[0])); addChild(image); image.x=20;//larg image.y=40;//haut } function handleH(event:Event):void { if ( lo1.data != "" ) { tab=lo1.data.split("\n"); nbr=tab.length; } } function clic(e:MouseEvent): void { var n=e.target.name; if ( n =="deb_b") courante = 0; if ( n =="av_b" ) courante ++ ; if ( n =="ar_b" ) courante -- ; if ( n =="fin_b") courante = nbr-1; majImage(); } public function Main () { var format = new TextFormat(); format.color=0xFF0000; format.font = 'sans'; format.size = 36; this.log.setTextFormat(format); lo1 = new URLLoader(); var o = this.loaderInfo.parameters; if ( o.file ) file=o.file; else file="mp3/petitpapa.mp3"; snd.load(new URLRequest(file)); snd.play(true); if ( o.txt ) txt=o.txt ; else txt="visio.txt"; trace(txt); var req = new URLRequest(txt); lo1.addEventListener(Event.COMPLETE, handleH); lo1.load(req); this.bar.av_b.addEventListener (MouseEvent.CLICK, clic); this.bar.ar_b.addEventListener (MouseEvent.CLICK, clic); this.bar.deb_b.addEventListener(MouseEvent.CLICK, clic); this.bar.fin_b.addEventListener(MouseEvent.CLICK, clic); } } } .end .text t1 font=f2 text="DEBUT" .button deb_b .show actif as=area y=-22 .show t1 as=idle .show t1 as=hover .show t1 as=pressed .on_press inside .end .text t2 font=f2 text="->" .button av_b .show actif as=area y=-22 .show t2 as=idle .show t2 as=hover .show t2 as=pressed .on_press inside .end .text t3 font=f2 text="<-" .button ar_b .show actif as=area y=-22 .show t3 as=idle .show t3 as=hover .show t3 as=pressed .on_press inside .end .text t4 font=f2 text="FIN" .button fin_b .show actif as=area y=-22 .show t4 as=idle .show t4 as=hover .show t4 as=pressed .on_press inside .end .sprite bar .put deb_b .put av_b x=65 .put ar_b x=130 .put fin_b x=185 .end .put bar 0 30 .end