xProteuSx Posted April 25, 2013 Share Posted April 25, 2013 Please keep in mind that I am a TOTAL NOOB. I am not asking anyone to code my entire project, but I am easily lost in many cases. Your help and patience is much appreciated ... My AS3 code looks something like this: var totalFeatureImageDownloads:Number = 0; //total file size of all feature images, in bytes var totalFeatureImageDownloaded:Number = 0; //total downloaded of all feature images, in bytes for each(var featureimage:XML in xml.featureimages.imgurl) { trace(featureimage); var featureImageRequest:URLRequest = new URLRequest(featureimage); var featureImageLoader:URLLoader = new URLLoader(featureImageRequest); totalFeatureImageDownloads = totalFeatureImageDownloads + featureImageLoader.bytesTotal; trace(featureImageLoader.bytesTotal); } Currently I have 3 images in the XML file, and their URL's are traced properly. However, bytesTotal always equals 0. Also, I know that this loop creates 3 identically named URLRequest's and 3 identically named URLLoaders. I probably need to create 3 differently named ones. I would like all the images to be downloaded simultaneously, and I need to calculate the combined file size for all three, along with the download status as a fraction (bytesLoaded / bytesTotal). I have multiple scenarios like this, and am stuck until I get this finished. Your help is much appreciated. Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/277293-as3-download-files-using-a-for-each-loop/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.