Field Losing Focus? - Correction

Ken Ray kray at sonsothunder.com
Mon Aug 12 19:20:00 CDT 2002


My mistake... I checked my original scripts and they don't work. You can't
get a mouseUp when the field is open, so you need to use mouseLeave; word 2
of the selectedChunk doesn't work properly - you need to use word 4; and I
used the wrong syntax for setting a custom property.  Here's the script that
works:

 -- Field 1 Script
 on mouseUp
   set the selChar of me to word 4 of (the selectedChunk)
 end mouseUp

 -- Button Script
 on mouseUp
   put the hilitedText of field 2 after char (the selChar of fld 1) of fld 1
 end mouseUp

Sorry about that...

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web site: http://www.sonsothunder.com/


----- Original Message -----
From: Ken Ray <kray at sonsothunder.com>
To: <use-revolution at lists.runrev.com>
Sent: Monday, August 12, 2002 6:02 PM
Subject: Re: Field Losing Focus?


> Following on Rob's coattails, here's an example:
>
> -- Field 1 Script
> on mouseUp
>   put word 2 of the selectedChunk into the selChar of me
> end mouseUp
>
> -- Button Script
> on mouseUp
>   put the hilitedText of field 2 after char (the selChar of fld 1) of fld
1
> end mouseUp
>
> Hope this helps,
>
> Ken Ray
> Sons of Thunder Software
> Email: kray at sonsothunder.com
> Web site: http://www.sonsothunder.com/d
>
>
> ----- Original Message -----
> From: Rob Cozens <rcozens at pon.net>
> To: <use-revolution at lists.runrev.com>
> Sent: Monday, August 12, 2002 5:37 PM
> Subject: Re: Field Losing Focus?
>
>
> > >Now, I want the text from field 2 to be placed into field 1 at the
> location
> > >of the cursor.  In the button's script, I have this:
> > >
> > >on mouseUp
> > >   focus on field 1
> > >   put word 2 of the selectedChunk into tChar
> > >   put the hilitedText of field 2 into tText
> > >   put tText after char tChar of field 1
> > >end mouseUp
> > >
> > >This works fine if you don't click in field 2.  As soon as you click in
> > >field 2, the selectedChunk  is empty.
> > >
> > >...
> > >Anyone have any ideas?
> >
> > Hi Dan,
> >
> > How about storing the field 1 selection on mouseUp and retrieving it
> > in field 2's mouseUp?  You could store it in a variable declared
> > local to both mouseUp handlers or in a custom property.
> > --
> >
> > Rob Cozens
> > CCW, Serendipity Software Company
> > http://www.oenolog.com/who.htm
> >
> > "And I, which was two fooles, do so grow three;
> > Who are a little wise, the best fooles bee."
> >
> > from "The Triple Foole" by John Donne (1572-1631)
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
>




More information about the use-livecode mailing list