xy
Richard Gaskin
ambassador at FourthWorld.com
Wed Jan 23 14:53:01 EST 2002
Tereza Snyder wrote:
>> new and improved... no flashy text...
>>
>> on xy
>> repeat until the mouseClick
>> get the mouseLoc&&" horz:"&the mouseH&&" vert:"&the mouseV
>> if it is not lastxy then
>> put it
>> put it into lastxy
>> end if
>> end repeat
>> end xy
>
> To avoid bottling up the engine servicing your loop:
>
> on mouseMove mX, mY
> put format( "horz: %d vert: %d", mX, mY )
> end mouseMove
>
> Scott Raney has told us in the past that "repeat until the mouseClick" is
> not a good idea because it bolixes up the event handling in the engine. I've
> found that mouseMove works wonderfully in situations where you'd be tempted
> to use "repeat until the mouse is up" or similar loops.
Very true, but in this case it turns a very simple handler into a project.
:)
The example you posted has a different effect than the goal being met by the
others: HC's traditional xy handler is invoked only until the mouse is
clicked, and then stops. Using a mousemove handler is an always-on
proposition, requiring a second handler to invoke it by setting a flag, and
a modification to the mousemove to check that flag.
Since xy is the only thing running when it's used, the performance
degredation is less of an issue.
--
Richard Gaskin
Fourth World Media Corporation
Custom Software and Web Development for All Major Platforms
Developer of WebMerge 1.9: Publish your database on the Web
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the metacard
mailing list