Re: Dual Purpose Applet Question
Re: Dual Purpose Applet Question
- Subject: Re: Dual Purpose Applet Question
- From: Michelle Steiner <email@hidden>
- Date: Tue, 5 Dec 2000 09:11:40 -0800
On 12/5/00 8:40 AM, Mr Tea <email@hidden> wrote
>
Is there any way to make an applet that behaves differently depending on
>
whether it is double-clicked or has something dragged onto it?
>
on open
>
beep 1
>
end open
>
on run
>
beep 2
>
end run
>
>
Sure enough, it beeps when I drag something onto it, but does nothing when I
>
double-click. Clearly the latter is different to running the script, as it
>
obediently beeps twice when run from the script editor. Where do I go from
>
here?
Your script is working properly; you just can't hear the extra beeps.
Try this:
on open
display dialog "help"
end open
on run
beep 1
end run
Actually, you don't need to use on run; you could also write it this way:
beep 1
on open
display dialog "help"
end open
--Michelle
----------------------------------------------------------------------
| Michelle Steiner | Hard as it may be to believe, my |
| email@hidden | life has been based on a true story. |
----------------------------------------------------------------------