Difference between revisions of "Talk:Textbox2Hovertext"

From Second Life Wiki
Jump to navigation Jump to search
(Comment on listen handles)
 
Line 13: Line 13:
Unless your object gets handed on to multiple subsequent owners :)
Unless your object gets handed on to multiple subsequent owners :)


If you want anyone to be able to set the hover text, then you could preclude multiple open listeners by removing the listen at the start of the touch event. It doesn't matter if it's already been removed by the timer code:-
If you want anyone to be able to set the hover text, then you could preclude multiple open listeners by removing the listen at the start of the touch event. It doesn't matter if it's already been removed by the timer code (or has never been assigned):-


<lsl>
<lsl>

Revision as of 08:05, 29 January 2013

Listeners:

As your llListen() always has the same arguments (same channel and filtering by owner only) each llListen will be assigned to the same listener handle. So there's no danger of accumulating open listens, and your timer code could be simplified to:-

<lsl>

   timer()
   {
       llListenRemove(listenhandle);
       llSetTimerEvent(0.0);
   }

</lsl>

Unless your object gets handed on to multiple subsequent owners :)

If you want anyone to be able to set the hover text, then you could preclude multiple open listeners by removing the listen at the start of the touch event. It doesn't matter if it's already been removed by the timer code (or has never been assigned):-

<lsl>

  touch_start(integer num)
   {
       llListenRemove(listenhandle);
       key target = llDetectedKey(0);
       llSetTimerEvent(30.0);
       listenhandle = llListen(1, "", target, "");
       llTextBox( target, "Set Hovertext", 1 );
   }

</lsl>

Omei Qunhua 07:01, 29 January 2013 (PST)