Help needed downloading a file to a folder
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Sat Dec 3 03:49:19 EST 2005
Hi Bill,
In the script of the "Cancel" button, you will find:
on mouseUp
set the uCancelMessage of this stack to true
end mouseUp
And in the ShowInfo handler (card's script) the first case in the
switch structure:
on ShowInfo pUrl,pFldName
local tStatus,tResult
-----
put URLStatus(pUrl) into tStatus
switch
case the uCancelMessage of this stack -- means the uCancelMessage
of this stack = true
set the thumbPos of sb "Progress" to 0
put "Download canceled" into fld pFldName
disable btn "Cancel"
unload url pUrl -- cleanup: the user canceled then you clear the
cache
exit to top
etc.
When the user click on the "Cancel" button, the uCancelMessage custom
prop is set to true.
As the ShowInfo handler is executed each 10 milliseconds, it triggers
the new custom prop status and cancel the download, unload the url.
But you are right: the cancel process is not well explained.
I'll revise it :-)
Best Regards from Paris,
Eric Chatonet.
Le 3 déc. 05 à 09:38, Bill Marriott a écrit :
> Actually, I did download and go through your stack...
> ...and went through it again after your post below...
>
> ...but for the life of me I can't find a section documenting how to
> cancel a
> download initiated with "load URL."
>
> There is a Cancel button in your sample that looks like it does the
> job --
> at least it kills the progress bar and reports "Canceled" -- but
> that button
> is cleverly protected from inspection. At least, simply clicking
> the Edit
> pointer isn't sufficient to probe the mysteries of your stack ;)
>
> My own guess was to use "unload url" command, but I found that even
> after
> using this, the download kept running cheerfully along in the
> background.
----------------------------------------------------------------
So Smart Software
For institutions, companies and associations
Built-to-order applications: management, multimedia, internet, etc.
Windows, Mac OS and Linux... With the French touch
Free plugins and tutorials on my website
----------------------------------------------------------------
Web site http://www.sosmartsoftware.com/
Email eric.chatonet at sosmartsoftware.com/
Phone 33 (0)1 43 31 77 62
Mobile 33 (0)6 20 74 50 86
----------------------------------------------------------------
More information about the use-livecode
mailing list