Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
Old 03-21-2008, 08:35 PM   #1
daz4126
NOOB
 
Join Date: Jul 2006
Posts: 29
Send a message via MSN to daz4126
Default Actionscript 3 problem "Error #2044: Unhandled IOErrorEvent:"

hello there,

I am currently having some problems with actionscript 3.0. i have created an equalizer using the soundMixer and this worked. to extend my knowledge furthur i have tried to creating it using an XML document to import songs and this is where i am having problems.

i will post the actions below they are all on the first frame of the file (I have left out the actions for the equalizer as i do not think this is where the problem is, however if you would like to see them please let me know and i will post it all):

ActionScript Code:
var loader:URLLoader = new URLLoader(); loader.addEventListener(Event.COMPLETE, onLoaded); lb.addEventListener(Event.CHANGE, itemChange); function itemChange(e:Event):void {  var s:Sound = new Sound(new URLRequest(lb.selectedItem.data));  s.play() } var xml:XML function onLoaded(e:Event):void{  xml = new XML(e.target.data);  //trace(xml)  var il:XMLList = xml.song;  for(var i:uint = 0; i<il.length(); i++){   lb.addItem({data:il.url.text()[i],      label:il.title.text()[i]});  } loader.load(new URLRequest("songs.xml"));

the error i get in the output window in this:

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at Soundspectrumxml_fla::MainTimeline/itemChange()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.controls::SelectableList/handleCellRendererClick()

Any help or advice you have will be useful and very appreciated.

thankyou in advance

Darren.
daz4126 is offline   Reply With Quote
Old 03-21-2008, 08:44 PM   #2
neznein9
Senior Member
 
Join Date: Jan 2008
Posts: 196
Default

Your loader is having trouble somewhere along the way. Throw this in around line 2-3 to listen for errors:

PHP Code:
loader.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):voidtrace(e): }); 
neznein9 is offline   Reply With Quote
Old 03-21-2008, 08:52 PM   #3
daz4126
NOOB
 
Join Date: Jul 2006
Posts: 29
Send a message via MSN to daz4126
Default

Hi, i have added that line of code on both lines 2 and 3 and in the compiler errors tab i am now getting 3 errors they are as follows:

1078: Label must be a simple identifier.
1083: Syntax error: rightbrace is unexpected.
1084: Syntax error: expecting rightparen before rightbrace.

The source for all three of these errors is:

loader.addEventListener(IOErrorEvent.IO_ERROR, function(e:IOErrorEvent):void{ trace(e): });

thanks again
daz4126 is offline   Reply With Quote
Old 03-21-2008, 08:54 PM   #4
daz4126
NOOB
 
Join Date: Jul 2006
Posts: 29
Send a message via MSN to daz4126
Default

Hi again, i found the error and now that line of code works in the output window however i am still getting the message:

Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at Soundspectrumxml_fla::MainTimeline/itemChange()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at fl.controls::SelectableList/handleCellRendererClick()
daz4126 is offline   Reply With Quote
Old 03-21-2008, 09:06 PM   #5
jaga
Senior Member
 
Join Date: Nov 2007
Posts: 529
Default

Hi. Neznein was close to the problem, but its the sound that's throwing the error..

instead of this part of the code:
ActionScript Code:
function itemChange(e:Event):void {  var s:Sound = new Sound(new URLRequest(lb.selectedItem.data));  s.play() }

try this..
ActionScript Code:
function itemChange(e:Event):void {  var s:Sound = new Sound();  s.addEventListener(IOErrorEvent.IO_ERROR, function(evt:IOErrorEvent):void { trace(evt) } );  s.load(new URLRequest(lb.selectedItem.data);  s.play() }
Now you'll get output, likely telling you that it cannot find the file that you're trying to load into the sound instance.. hope that helps!
jaga is offline   Reply With Quote
Old 03-21-2008, 09:20 PM   #6
daz4126
NOOB
 
Join Date: Jul 2006
Posts: 29
Send a message via MSN to daz4126
Default

Thankyou this helps a lot. I am now getting this in the output window:

[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: <A href="file:///C|/Users/Darren/Desktop/Flash/"03">file:///C|/Users/Darren/Desktop/Flash/"03 - escape from the city.mp3""]

after the .mp3 i am noticing that there are two lots of " so i will try removing the " from the XML file and see what happens. if i am still getting problems i will post again.

Thanks for your help
daz4126 is offline   Reply With Quote
Old 03-21-2008, 09:22 PM   #7
daz4126
NOOB
 
Join Date: Jul 2006
Posts: 29
Send a message via MSN to daz4126
Default

I realised that inserting the " marks into the url tag in the XML was the mistake and it is now working properly. Thankyou for all your help
daz4126 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with passing an ideia to actionscript miguelp ActionScript 2.0 0 06-05-2006 08:25 PM
Sound problem in Actionscript??!! Christam1 ActionScript 2.0 2 10-06-2005 07:29 PM
Problem with controlling multiple sound using actionscript RComet ActionScript 1.0 (and below) 2 09-19-2005 10:59 AM
Simple ActionScript problem flash junkie ActionScript 2.0 2 06-23-2005 06:48 PM
gotoAndPlay() Child movieclip from frame actionscript - problem. zen-x ActionScript 2.0 3 03-08-2005 03:17 PM


All times are GMT. The time now is 01:40 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.