I am adding a progress bar to my "Upload" stack and am having a few issues.
Here is my code on the card:
Code: Select all
on displayProgress
--Progress bar
global gFilePath
put URLStatus(field "fileField") into theStatus
show group "Progress Bar"
switch item 1 of theStatus
case "loading"
set the thumbPosition of sb "Progress" of group "Progress Bar" to the round of (item 2 of theStatus / item 3 of theStatus * 100)
put the round of (item 2 of theStatus / 1024) && "KB loaded" && the round of (item 3 of theStatus / 1024) into field "status"
send "displayProgress" to me in 1 second
break
case "cached"
put URL field "fileField" into URL ("file:" & gFilePath)
cleanUp
break
case "error"
answer "Error" & return theStatus
break
default
send "displayProgress" to me in 1 second
break
end switch
end displayProgress
Code: Select all
on mouseUp
global gFilePath
set the itemDel to "/"
put last item of field "fileField" into gFilePath
load URL field "fileField"
displayProgress
uLoad
end mouseUp
Also, I would rather have the progress bar float above the current window during upload in it's own message window. I can't find anywhere in the forums or lesson info on how to accomplish this. I am fine with hiding and showing the progress bar each time I load, but would prefer the floating window idea.
Any ideas?
Thanks
Tom