

Now edit the script of the Download button and replace the script with this: on mouseUp Use the Inspector to change the name to "ProgressBar" (1). Make it wider if you like, although it doesn't matter. These two numeric items give us the data we need to set up a progress bar and script the changing display.ĭrag a progress bar into the window from the Tools palette. The third item shows the total number of bytes to be downloaded in this file. The second item shows the number of bytes already downloaded. The messages of interest when scripting a progress indicator are the "loading" messages which come as a line with three items. The "cached" status message is actually sent to the "downloadComplete" handler, which we haven't written yet.Ī problem will give a status of "error" or "timeout". loading,number_of_bytes_downloaded,total_number_of_bytes The first parameter is the URL of the file being downloaded.įor a successful download, you will see the following sequence of status reports: These are what is sent to the status callback handler as it's second parameter. In the Additional Comments section, you will see a list of the values that the URLstatus can have. Now you have seen what messages the libURLSetStatusCallback produces, so let's go on to do something more interesting with this data,Ĭheck the Dictionary entry for URLStatus.

Watch the Message box as the file downloads and you will see various messages appear. Callbacks are used to track the progress of the download and to detect the end of the download.Ĭompile the script, close the editor and change to the browse tool.
#APP STORE DOWNLOAD PROGRESS NOT SHOWING WINDOWS#
You send off a load command and then the handler continues, windows can still be moved and resized so it doesn't feel as if your app has frozen. We are using the "load" command here as it is a non-blocking command.

this is the status callback message which gets called regularly during the download - pStatus will show some initialization messages, then - loading,bytesReceived,bytesTotal put pStatus LibURLSetStatusCallback "showProgress", the long name of me - start the download process, telling LiveCode to call the "downloadComplete" handler when finished load URL tDownloadLink with message "downloadComplete"Įnd mouseUp command showProgress pURL, pStatus put the address of the file we want to download into a variable put " " into tDownloadLink - 2MB - set up a message to show the status of the download as it progresses Edit the script of the Download button as follows: on mouseUp
