12/11/2013, 18:28
|
| | Fecha de Ingreso: noviembre-2013
Mensajes: 1
Antigüedad: 11 años Puntos: 0 | |
Problema con As3 que tal gente, estoy tratando de hacer un tutorial para una galeria de video y me encuentro con este error "Escena 1, Capa 'as3', Fotograma 1 1084: Error de sintaxis: se esperaba rightbrace antes de end of program." al correr este codigo, soy nuevo en Flash, espero me puedan ayudar, gracias!
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.MouseEvent;
import fl.video.*;
import fl.video.FLVPlayback;
var counter:uint=0;
var myxml:XML=new FLVPlayback();
var flvPlayer:FLVPlayback=new FLVPlayback();
flvPlayer.skin="SkinOverPlaySeekMute.swf";
flvPlayer.autoPlay=false;
flvPlayer.skinAutoHide=true;
addChild(flvPlayer);
var myLoader: URLLoader=new URLLoader();
myLoader.load(new URLRequest("videos.xml"));
myLoader.addEventListener(Event.COMPLETE,loaded);
function loaded(event:Event){
myxml=XML(event.target.data);
var videoIndex:Number= myxml.video.lenght()-1;
trace(myxml, videoIndex);
centerAlingnAndPlay();
leftBtn.addEventListener(MouseEvent.CLICK,prevVide o);
rightBtn.addEventListener(MouseEvent.CLICK, nextVideo);
function prevVideo(event:MouseEvent){
if(counter>0){counter--;centerAlignAndPlay()}
else{counter=3; centerAlignAndPlay()}
function nextVideo(event:MouseEvent){
if(counter<videoIndex){counter++; centerAlignAndPlay()}
else{counter=0;centerAlignAndPlay()}}
flvPlayer.addEventListener(Event.COMPLETE,complete Play);
function completePlay (event:Event):void{
if(counter<videoIndex){counter++;centerAlignAndPla y()}
else{counter=0;centerAlignAndPlay()}
}
}
function centerAlignAndPlay(){
flvPlayer.source=myxml.video[counter].@movie;
flvPlayer.addEventListener(VideoProgressEvent.PROG RESS,onFlvPlayback_PROGRESS);
function onFLVPlayback_PROGRESS(event:VideoProgressEvent):v oid {
var total:Number= event.target.bytesTotal;
var part:Number= event.target.bytesLoaded;
var percentage:Number= part / total;
var percentageFormatted:String=Math.floor(percentage*1 00)+"%";
status_txt.text=percentageFormatted+"loaded";
if(part==total){flvPlayer.play();status_txt.text=" ";}
}
var mywidth = (stage.stageWidth-myxml.video[counter].@width)/2;
var myheight = (stage.stageHeight-myxml.video[counter].@height)/2;
flvPlayer.width=myxml.video[counter].@width;
flvPlayer.height=myxml.video[counter].@height;
flvPlayer.x=mywidth;
flvPlayer.y=myheight;
title.text=myxml.video[counter].@title;
} |