Hoy ingrese al sitio navegando con google chrome cargo el primer tema hasta el 55% y se quedo trabado!, hasta que me tiro este error!
Código :
Error: Error #2029: Este objeto URLStream no tiene una secuencia abierta.
at flash.media::Sound/close()
at reproductor_fla::player_2/closeStream()
at reproductor_fla::playListt_38/nextPrevSound()
at reproductor_fla::control_7/nextonMouseDown()
Aca les dejo una imagen del error que me tiro en google chorme!
tambien les dejo el codigo relacionado con la 3 linea del error
Código :
import spectrum.*;
var sound:Sound;
var channel:SoundChannel;
var spectrumGraph:SpectrumGraph;
var isPlaying:Boolean = false;
var soundOpend:Boolean = false;
var totalLoaded:Boolean = false;
var percentBufferd:Number;
var percentPlayed:Number;
var position:Number;
var length:Number;
var currentVolume:Number =.8;
var allowStream:Boolean = false;
con.mouseEnabled = false;
con.mouseChildren = false;
function init(path:String):void {
sound = null;
channel = null;
sound = new Sound(new URLRequest(path));
sound.addEventListener(Event.OPEN, openSound);
sound.addEventListener(IOErrorEvent.IO_ERROR, onSoundIOError);
}
function onSoundIOError(e:IOErrorEvent) {
}
function closeStream():void {
sound.close();
}
function resetSound():void {
sound = null;
channel.stop();
stopSound();
spectrumGraph.del();
}
function openSound(e:Event):void {
notshowConectMessage();
soundOpend = true;
channel = sound.play();
channel.soundTransform = new SoundTransform(currentVolume);
playSound();
spectrumGraph = new SpectrumGraph(player.vizual);
MovieClip(player.control.vol_mc).init();
onid3();
MovieClip(playList).enableThumbs();
}
function AllowStream():void {
allowStream = true;
}
function delAllowStream():void {
allowStream = false;
}
function playSound():void {
addEventListener(Event.ENTER_FRAME, EF);
}
function stopSound():void {
removeEventListener(Event.ENTER_FRAME, EF);
channel.stop();
}
function EF(e:Event):void {
var loaded:Number = sound.bytesLoaded;
var total:Number = sound.bytesTotal;
position = channel.position;
length = sound.length;
if (soundOpend == true && total >0) {
isPlaying = true;
percentBufferd = loaded/total;
length /= percentBufferd;
if (percentBufferd <1) {
AllowStream();
} else {
delAllowStream();
}
percentPlayed = position / length;
spectrumGraph.update();
player.control.scruber_mc.scrub();
player.info_text_playlist_mc.updateText();
player.info_text_playlist_mc.updateTime();
if (loaded == total) {
totalLoaded = true;
} else {
totalLoaded = false;
}
} else {
isPlaying = false;
}
if (percentPlayed>0.997) {
MovieClip(playList).SoundComplete();
}
}
function setControlText(ar:Array,ar2:Array,id:int):void {
player.info_text_playlist_mc.currwentSong_txt.text = ar[id] + " - " + ar2[id];
}
function setTotalnrOfSongs(nr:int):void {
player.info_text_playlist_mc.total_movie_txt.text = nr;
}
function setCurrentNrOfSongs():void {
player.info_text_playlist_mc.curent_movie_txt.text = MovieClip(playList).currentSongID + 1;
}
function notshowConectMessage():void {
con.alpha = 0;
MovieClip(playList).enablePl_close();
MovieClip(player.control).resetControl();
}
function showConectMessage():void {
con.alpha = 1;
con.gotoAndPlay(2);
setChildIndex(con,numChildren - 1);
MovieClip(playList).disablePl_close();
MovieClip(player.control).disableControl();
}
Este codigo tambien esta relacionado con la 3 linea del error, esta insertado dentro del mismo clip de pelicula (el clip Se llama player)
Código :
var songArtist:String;
var songName:String;
var songAlbum:String;
var songYear:String;
var songGenere:String;
var songComments:String;
setInfoInvisible();
function setInfoInvisible():void {
info.alpha = 0;
info.mouseEnabled = false;
info.mouseChildren = false;
}
function setInfoVisible():void {
info.alpha = 1;
info.mouseEnabled = true;
info.mouseChildren = true;
}
function onid3():void {
sound.addEventListener(Event.ID3, onID);
function onID(e:Event):void {
songArtist= sound.id3.artist;
songName=sound.id3.songName;
songAlbum = sound.id3.album;
songYear = sound.id3.year;
songGenere = sound.id3.genre;
songComments = sound.id3.comment;
populateInfo();
}
}
function populateInfo():void {
if (songArtist != null) {
info.songArtist_txt.text = songArtist;
} else {
info.songArtist_txt.text = "unspecified";
}
if (songName != null) {
info.songName_txt.text = songName;
} else {
info.songName_txt.text = "unspecified";
}
if (songAlbum != null) {
info.songAlbum_txt.text = songAlbum;
} else {
info.songAlbum_txt.text = "unspecified";
}
if (songYear != null) {
info.songYear_txt.text = songYear;
} else {
info.songYear_txt.text = "unspecified";
}
if (songGenere != null) {
info.songGenere_txt.text = songGenere;
} else {
info.songGenere_txt.text = "unspecified";
}
if (songComments != null) {
info.songComments_txt.text = songComments;
} else {
info.songComments_txt.text = "unspecified";
}
}
info.pl_close.buttonMode = true;
playList.pl_close.buttonMode = true;
info.pl_close.addEventListener(MouseEvent.MOUSE_DOWN, plDown);
info.pl_close.addEventListener(MouseEvent.MOUSE_OVER, plOver);
info.pl_close.addEventListener(MouseEvent.MOUSE_OUT, plOut);
playList.pl_close.addEventListener(MouseEvent.MOUSE_DOWN, playListDown);
playList.pl_close.addEventListener(MouseEvent.MOUSE_OVER, plOver);
playList.pl_close.addEventListener(MouseEvent.MOUSE_OUT, plOut);
function plDown(e:MouseEvent):void {
MovieClip(player.control).resetControl();
setInfoInvisible();
}
function plOver(e:MouseEvent):void {
e.target.parent.gotoAndPlay("s1");
}
function plOut(e:MouseEvent):void {
e.target.parent.gotoAndPlay("s2");
}
function playListDown(e:MouseEvent) {
MovieClip(player.control).resetControl();
setPLInvisible();
}
Este codigo tambien esta relacionado con la 3 linea del error, esta insertado dentro del mismo clip de pelicula (el clip Se llama player)
Código :
setPLInvisible();
function setPLInvisible():void {
playList.alpha = 0;
playList.mouseEnabled = false;
playList.mouseChildren = false;
}
function setPLVisible():void {
playList.alpha = 1;
playList.mouseEnabled = true;
playList.mouseChildren = true;
}
este codigo esta relacionado con la cuarta linea del error
Código :
import fl.transitions.*;
import fl.transitions.easing.*;
var nextPosition:Number = 0;
var allwChangePosition:Boolean = true;
var allowPress:Boolean = true;
var nextMoveTween:Tween;
prev.buttonMode = true;
next.buttonMode = true;
prev.addEventListener(MouseEvent.MOUSE_OVER, prevOnMover);
prev.addEventListener(MouseEvent.MOUSE_OUT, nextOnMout);
next.addEventListener(MouseEvent.MOUSE_OVER, prevOnMover);
next.addEventListener(MouseEvent.MOUSE_OUT, nextOnMout);
next.addEventListener(MouseEvent.MOUSE_DOWN, moveNext);
prev.addEventListener(MouseEvent.MOUSE_DOWN, moveNext);
function prevOnMover(e:MouseEvent):void {
e.target.parent.gotoAndPlay("s1");
}
function nextOnMout(e:MouseEvent):void {
e.target.parent.gotoAndPlay("s2");
}
function moveNext(e:MouseEvent):void {
if (allwChangePosition == true) {
if (e.target.parent.name == "next" && thumbHolder.x > (xallowed * -1) && allowPress == true) {
allowPress = false;
disableNextAndPrev();
nextPosition = nextPosition - withToAdd;
} else if (e.target.parent.name == "prev" && thumbHolder.x < -2 && allowPress == true) {
allowPress = false;
disableNextAndPrev();
nextPosition = nextPosition + withToAdd;
}
nextMoveTween = new Tween(thumbHolder,"x",Regular.easeOut,thumbHolder.x, nextPosition,1,true);
nextMoveTween.addEventListener(TweenEvent.MOTION_STOP, onMotionStop);
allwChangePosition = false;
function onMotionStop(e:TweenEvent):void {
allwChangePosition = true;
allowPress = true;
enableNextAndPrev();
trace(thumbHolder.x);
}
}
}
function disableNextAndPrev():void {
next.mouseEnabled = false;
next.mouseChildren = false;
prev.mouseEnabled = false;
prev.mouseChildren = false;
}
function enableNextAndPrev():void {
next.mouseEnabled = true;
next.mouseChildren = true;
prev.mouseEnabled = true;
prev.mouseChildren = true;
}
Esta es otra parte del codigo que esta relacionado con la 4 linea del error, insertado en el mismo clip de pelicula (el clip se llama playlistt)
Código :
import fl.transitions.*;
import fl.motion.easing.*;
var totalEntries:Number;
var spacer:Number = 20;
var songsName:Array = new Array();
var songsArtist:Array = new Array();
var sngsPhat:Array = new Array();
var songsImagePath:Array = new Array();
var loader:URLLoader = new URLLoader();
var xml:XML;
var xmlList:XMLList = new XMLList();
var withToAdd:Number;
var xallowed:Number = 0;
var currentSongID:int = 0;
initPlayer();
function initPlayer():void {
loader.load(new URLRequest("playList.xml"));
loader.addEventListener(Event.COMPLETE,onComplete);
function onComplete(e:Event):void {
xml = new XML(e.target.data);
xmlList = xml.song;
totalEntries = xml.song.length();
attachThumbs(totalEntries,xmlList);
MovieClip(parent).init(sngsPhat[0]);
setInitText();
MovieClip(parent).setControlText(songsArtist,songsName,0);
MovieClip(parent).setCurrentNrOfSongs();
disableThumbs();
}
}
function setInitText():void {
songArtist_txt.text = songsArtist[0];
songName_txt.text = songsName[0];
MovieClip(parent).setTotalnrOfSongs(totalEntries);
}
function setText(id:int):void {
songArtist_txt.text = songsArtist[id];
songName_txt.text = songsName[id];
}
function attachThumbs(totalEntries:Number,xmlList:XMLList):void {
var a:Number = 0;
while (a < totalEntries) {
var thumbs:MovieClip = new thumb();
thumbs.name = "thumb" + a;
thumbs.buttonMode = true;
thumbs.id = a;
thumbs.y = 20;
thumbs.x = 15 + (thumbs.width + spacer) * a;
songsName[a] = xmlList.songName[a];
sngsPhat[a] = xmlList.songPath[a];
songsArtist[a] = xmlList.songArtist[a];
songsImagePath[a] = xmlList.thumPath[a];
thumbs.hitPlace.addEventListener(MouseEvent.MOUSE_OVER, thumbOnMouseOver);
thumbs.hitPlace.addEventListener(MouseEvent.MOUSE_OUT, thumbOnMouseOut);
thumbs.hitPlace.addEventListener(MouseEvent.MOUSE_DOWN, thumbOnMouseDown);
thumbHolder.addChild(thumbs);
loadThumbs(thumbs,songsImagePath[a]);
a = a+1;
withToAdd = (thumbs.width*2) + (spacer *2);
xallowed =thumbHolder.width - ((thumbs.width - spacer) *3);
}
}
function loadThumbs(placeHolder:MovieClip,path:String):void {
var loader:Loader = new Loader();
loader.load(new URLRequest(path));
loader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
function onInit(e:Event):void {
placeHolder.t.t.addChild(loader.content);
}
}
function thumbOnMouseOver(e:MouseEvent):void {
setText(e.target.parent.id);
e.target.parent.gotoAndPlay("s1");
}
function thumbOnMouseOut(e:MouseEvent):void {
e.target.parent.gotoAndPlay("s2");
}
function thumbOnMouseDown(e:MouseEvent):void {
setcurrentSongID(e.target.parent.id);
disableThumbs();
if (MovieClip(parent).allowStream == true) {
MovieClip(parent).closeStream();
}
MovieClip(parent).resetSound();
MovieClip(parent).setCurrentNrOfSongs();
MovieClip(parent).init(sngsPhat[e.target.parent.id]);
MovieClip(parent).setControlText(songsArtist,songsName,e.target.parent.id);
MovieClip(parent).showConectMessage();
}
function disableThumbs():void {
for (var i:int = 0; i<totalEntries; i++) {
MovieClip(thumbHolder.getChildByName("thumb" + i)).mouseEnabled = false;
MovieClip(thumbHolder.getChildByName("thumb" + i)).mouseChildren = false;
}
}
function enableThumbs():void {
for (var i:int = 0; i<totalEntries; i++) {
MovieClip(thumbHolder.getChildByName("thumb" + i)).mouseEnabled = true;
MovieClip(thumbHolder.getChildByName("thumb" + i)).mouseChildren = true;
}
}
function setcurrentSongID(id:int):void {
currentSongID = id;
}
function disablePl_close():void {
pl_close.mouseEnabled = false;
pl_close.mouseChildren = false;
}
function enablePl_close():void {
pl_close.mouseEnabled = true;
pl_close.mouseChildren = true;
}
function nextPrevSound(btn:String):void {
if (btn == "next_mc") {
currentSongID = currentSongID + 1;
trace("PRESING next_mc");
} else if (btn == "prev_mc") {
currentSongID = currentSongID - 1;
trace("PRESING prev_mc");
}
if (currentSongID >= totalEntries) {
currentSongID = 0;
} else if ( currentSongID == -1) {
currentSongID = totalEntries-1;
}
setcurrentSongID(currentSongID);
if (MovieClip(parent).allowStream == true) {
MovieClip(parent).closeStream();
}
MovieClip(parent).setCurrentNrOfSongs();
MovieClip(parent).resetSound();
MovieClip(parent).init(sngsPhat[currentSongID]);
MovieClip(parent).setControlText(songsArtist,songsName,currentSongID);
MovieClip(parent).showConectMessage();
}
function SoundComplete() {
currentSongID = currentSongID + 1;
if (currentSongID >= totalEntries) {
currentSongID = 0;
} else if ( currentSongID == -1) {
currentSongID = totalEntries-1;
}
setcurrentSongID(currentSongID);
if (MovieClip(parent).allowStream == true) {
MovieClip(parent).closeStream();
}
MovieClip(parent).setCurrentNrOfSongs();
MovieClip(parent).resetSound();
MovieClip(parent).init(sngsPhat[currentSongID]);
MovieClip(parent).setControlText(songsArtist,songsName,currentSongID);
MovieClip(parent).showConectMessage();
}
Este codigo esta relacionado con la 5 linea del error
Código :
import fl.transitions.*;
import fl.transitions.easing.*;
nf.addEventListener(MouseEvent.MOUSE_DOWN, nfDown);
pl.addEventListener(MouseEvent.MOUSE_DOWN, plDown);
function nfDown(e:MouseEvent):void {
disableControl();
showInfo();
}
function plDown(e:MouseEvent):void {
disableControl();
showPL();
}
function showInfo():void {
rootVars.setInfoVisible();
TransitionManager.start(rootVars.info, {type:PixelDissolve, direction:Transition.IN, duration:1, easing:Regular.easeIn, xSections:140, ySections:140});
}
function showPL():void {
rootVars.setPLVisible();
TransitionManager.start(rootVars.playList, {type:PixelDissolve, direction:Transition.IN, duration:1, easing:Regular.easeIn, xSections:140, ySections:140});
}
Este codigo tambien esta relacionado con la 5 linea del error, esta insertado dentro del mismo clip de pelicula (el clip Se llama Control)
Código :
var rootVars:MovieClip = MovieClip(parent.parent);
var position:Number;
function disableControl():void {
dizBtn.mouseEnabled = true;
dizBtn.mouseChildren = true;
trace("disabling controls");
}
function resetControl():void {
dizBtn.mouseEnabled = false;
dizBtn.mouseChildren = false;
trace("enabling contols");
}
disablePlayBtn();
var xxx:String = "test";
function disablePlayBtn():void {
play_btn.mouseEnabled = false;
play_btn.mouseChildren = false;
}
function enablePlayBtn():void {
play_btn.mouseEnabled = true;
play_btn.mouseChildren = true;
}
pause_btn.buttonMode = play_btn.buttonMode = stop_btn.buttonMode = prev_mc.buttonMode = next_mc.buttonMode = pl.buttonMode = nf.buttonMode = true;
pause_btn.addEventListener(MouseEvent.MOUSE_DOWN, downPause);
function downPause(e:MouseEvent):void {
enablePlayBtn();
rootVars.channel.stop();
position = rootVars.channel.position;
rootVars.stopSound();
}
play_btn.addEventListener(MouseEvent.MOUSE_DOWN, downPlay);
function downPlay(e:MouseEvent):void {
rootVars.playSound();
disablePlayBtn();
rootVars.channel.stop();
rootVars.channel = rootVars.sound.play(position);
rootVars.channel.soundTransform = new SoundTransform(rootVars.currentVolume);
}
stop_btn.addEventListener(MouseEvent.MOUSE_DOWN, downStop);
function downStop(e:MouseEvent):void {
rootVars.channel.stop();
position = 0;
enablePlayBtn();
rootVars.channel.stop();
scruber_mc.scruber_button_sus_mc.width = position;
rootVars.stopSound();
}
handleButtons();
function handleButtons() {
stop_btn.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
stop_btn.addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
pause_btn.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
pause_btn.addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
play_btn.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
play_btn.addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
prev_mc.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
prev_mc.addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
next_mc.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
next_mc.addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
pl.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
pl.addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
nf.addEventListener(MouseEvent.MOUSE_OVER,onMouseOver);
nf.addEventListener(MouseEvent.MOUSE_OUT,onMouseOut);
function onMouseOver(e:MouseEvent):void {
e.target.parent.gotoAndPlay("s1");
}
function onMouseOut(e:MouseEvent):void {
e.target.parent.gotoAndPlay("s2");
}
}
//CHANGE MELODY//
next_mc.addEventListener(MouseEvent.MOUSE_DOWN,nextonMouseDown);
prev_mc.addEventListener(MouseEvent.MOUSE_DOWN,nextonMouseDown);
function nextonMouseDown(e:MouseEvent) {
rootVars.playList.nextPrevSound(e.target.parent.name);
}
espero que este claro!, y no generar ninguna confucion!
Gracias!