in Education by
Alright, currently I have my SWF hitting a php file that will go and find all the files I specify to it, add their sizes together and return their combined sizes as one number. I then use this number with a ProgressEvent listener to determine the current percentage of files downloading for that particular section of the website. Pretty straightforward right? Well now using that PHP file is out of the question and I'm attempting to do everything inside the SWF instead of having it hit an outside script to get the numbers I need. Is there any good way to get a file's size BEFORE I start loading it into flash? I really need the preloader to be a 0 to 100% preloader so I need the total number of bytes I will be downloading before it actually starts. One thought I had was to just go through the array holding the file URLs, start loading them, getTotalBytes without displaying any loading, kill the load on the first tick, add up all those total bytes numbers, and then start the actual downloading process. This method seems very ugly and it will be a huge time waste as every time the user hits a pre loader on the site it will probably take a second or two to run through all the files, find their total and then actually start downloading. Is there a better solution to this problem without going outside of flash to get the size of those files? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You could do an HTTP HEAD request to the server for the files. This will return the header info (including file size) but not the actual file. You could then make a GET request to load the files. http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html (Check out section 9.4 HEAD) What I would probably do is a two tier progress bar (with 2 progress bars). One showing overall progress (0 to 100%) and one showing per file progress (as each file is downloaded). That way, as long as you know the number of files to load, you can do the total progress without first having to hit the server to get the file sizes. mike chambers [email protected]

Related questions

0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 17, 2022 in Education by JackTerrance
0 votes
    I want to check whether the color = a certain color then appropriately react. This is done in flash ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 18, 2022 in Education by JackTerrance
0 votes
    I'm following @zdim's recursive solution in this question fastest way to sum the file sizes by owner in ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 26, 2022 in Education by JackTerrance
0 votes
    Which of the following design approaches help in building sites that are optimized for varied screen sizes ... Adaptive Web Design Progressive Enhancement Mobile Optimized Design...
asked Sep 5, 2021 in Technology by JackTerrance
0 votes
    Which of the following design approaches help in building sites that are optimized for varied screen sizes? (1) ... Web Design (3)Progressive Enhancement (4)Responsive Web Design...
asked Jun 1, 2021 by JackTerrance
0 votes
    The integer format tracks only the locations and sizes of blocks of data. (a) True (b) False I had ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 31, 2021 in Education by JackTerrance
0 votes
    What are the sizes of the Azure VM?...
asked Dec 28, 2020 in Technology by JackTerrance
+1 vote
    You need to deploy a virtual machine on Azure with a low memory entry level requirement. Which virtual machine sizes should you consider choosing?...
asked Oct 20, 2020 in Technology by JackTerrance
0 votes
    I have the following table relationship in my database: Parent / \ Child1 Child2 \ / GrandChild I am ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 19, 2022 in Education by JackTerrance
0 votes
    What is the probability of getting a multiple of 3 when a die is thrown. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    A die is thrown. What is the chance of getting a face with dots as multiple of 2. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    A die is thrown. Find the probability of getting: (i) a prime number (ii) 2 or 4 (iii) a multiple of 2 ... number lying between 2 and 6 Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    A die thrown. Find the probability of getting: (i) a prime number (ii) 2 or 4 (iii) a multiple of 2 or 3 Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    A die is thrown. Find the probability of getting: (i) a prime number (ii) 2 or 4 (iii) a multiple of 2 or 3 Select the correct answer from above options...
asked Nov 22, 2021 in Education by JackTerrance
...