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: 1 votes, 5.00 average. Display Modes
Old 01-03-2011, 11:24 PM   #1
northmantif
dont Re Member
 
Join Date: May 2009
Location: Poland
Posts: 737
Default BulkLoader says:"Error" I say:"load something else instead".

Hi!
BulkLoader is cute, and loads data well, even from setup.xml file. So Me, little bastard, write in the setup.xml wrong path to file...cunning
Then BulkLoader says:"Error" I will not handle rest of the thousand images that were going to download... but I would like to say to BulkLoader: "good good Loader, please, load that image instead (with graphical interpretation that right image wasnt loaded), and then resume loading for rest of images...
That's saying little poetically (lol), but I deal with the issue, when wrong path was given to the image for BulkLoader instance.
So in FOR loop i am traversing setup.xml file in which I have paths to images that are to be loaded. If BulkLoader can not load one of the images it never fires COMPLETE event it just stops tracing where problem lies. That' cool by the way... i see the path in the Output Panel, but is there a way to
pause BulkLoader when error occurs, load something different instead and go ahead with rest of images?
Tried to set ErrorEvent for loading instance, but if I put to the handler code, to load other image instead, BulkLoader doesn't seem to load it. What's more disqusting it doesnt resume its download...
Anybody with experience with BulkLoader?
Thanks for viewing

Last edited by northmantif; 01-03-2011 at 11:28 PM.
northmantif is offline   Reply With Quote
Old 01-04-2011, 01:34 AM   #2
jsprclimber123
Breaking things...
 
Join Date: Jan 2010
Posts: 635
Default

Trying listening for an IOErrorEvent, and act accordingly. This shouldn't through off your for loop, and will allow you to continue on as normal.

I'm not sure if BulkLoader throws these events (it should, theoretically) but if it does, this would be a way to not have a bad file break the loop.
jsprclimber123 is offline   Reply With Quote
Old 01-04-2011, 09:10 AM   #3
northmantif
dont Re Member
 
Join Date: May 2009
Location: Poland
Posts: 737
Default

Thanks for idea. Actually it is little weird for me, as I deal with errors rarely, and when path is misleading the BulkLoader fires common ErrorEvent.ERROR, or BulkLoader.ERROR and not IOErrorEvent.IO_ERROR. My problem now is to tell BulkLoader to load other data instead the wrong ones...
Cheers
northmantif is offline   Reply With Quote
Old 01-04-2011, 11:42 AM   #4
northmantif
dont Re Member
 
Join Date: May 2009
Location: Poland
Posts: 737
Default

finally BulkLoader said. Ok man, whazza problem?
the not loaded image registered himself with the (ErrorEvent.ERROR, bulkLoaderDidntLoadMe), so when thats occured the image growled:"
ActionScript Code:
function bulkDidntLoadMe(e:ErrorEvent) {     if(e.target.status == LoadingItem.STATUS_ERROR)     {         var item = LoadingItem(e.target).id;         //trace(loader.itemsLoaded);         loader.remove(item,true);         loader.add("basePath"+rsXML.noImage[0],{id:item});                 //load image for other tag in setup.xml file: <noImage>brokenLinkImage.jpg</noImage>         loader.loadNow(item);           } }
"
...and the BulkLoader stand on his feet and moved quickly from its desk to
big shiny silver machine that was positioned near the wall and push big red button in his loading machine.
Thundering, warning signal filled the room, and blinking colors of red and orange clinged to the wall.
Replaced content immediately appeared on the scanner monitor, glowing with colorful tints...
Then BulkLoader came back to its desk, making duties forward...completing the task.
Thank you

Last edited by northmantif; 01-04-2011 at 11:48 AM.
northmantif is offline   Reply With Quote
Old 01-04-2011, 12:54 PM   #5
jsprclimber123
Breaking things...
 
Join Date: Jan 2010
Posts: 635
Default

Love the imagery, glad you got it sorted out.

Thanks for the info, might be useful when and if I use a BulkLoader application
jsprclimber123 is offline   Reply With Quote
Old 01-04-2011, 03:10 PM   #6
northmantif
dont Re Member
 
Join Date: May 2009
Location: Poland
Posts: 737
Default

Quote:
Originally Posted by jsprclimber123 View Post
Love the imagery, glad you got it sorted out.

Thanks for the info, might be useful when and if I use a BulkLoader application
that's why I posed the code. Looked for it everywhere, and even on the discussion list thera topic's on this issue, thera tips, but no fast solution.
Cheers
northmantif is offline   Reply With Quote
Old 08-27-2012, 03:40 PM   #7
kristiyan
Registered User
 
Join Date: Aug 2012
Posts: 1
Default

Hi there,
I'm a little bit too late but here's the quick solution:
ActionScript Code:
yourBulkLoaderInstance.removeFailedItems();
This function removes the item(s) that failed to load and resumes the loader. You should put this in your error handler function.
I found this in the documentation, so you should consider RTFM next time
Just kidding
kristiyan 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


All times are GMT. The time now is 05:07 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.