Create Image, Hide Image

Sarah sarahr at genesearch.com.au
Sun Dec 8 21:18:00 EST 2002


To vary the responses you have so far, how about checking to see if 
image "Holder" exists first and only creating it if it isn't there 
already. Then you are covered for all possibilities. I have also added 
a send command so that the whole stack is not frozen for the 3 seconds 
delay.

on mouseUp
   answer file empty
   put it into thisPict
   if there is not an image "Holder" then
     create invisible image "Holder"
     set the rect of it to the rect of fld pictFld
     set the lockLoc of it to true
   end if
   set the filename of image "Holder" to thisPict
   show image "Holder"
   send "choose browse tool" to me in 1 tick
   send hideImage to me in 3 seconds
end mouseUp

on hideImage
   hide image "Holder"
end hideImage

Cheers,
Sarah

On Sunday, December 8, 2002, at 09:12  am, JamesHBeckmann at aol.com wrote:

> Bear with this new user:
>
> I created a NEW stack, placed one fld "pictfld" and one button 
> "Display" on
> it.  I put the following script into the button:
>
> on mouseUp
>   answer file empty
>   put it into thisPict
>   set the rect of templateimage to the rect of fld pictFld
>   set the filename of templateimage to thisPict
>   set the lockLoc of templateimage to true
>   create image "Holder"
>   wait 3 secs
>   hide image "Holder"
>   send "choose browse tool" to me in 1 tick
> end mouseUp
>
> So the script works on the first run, showing the image and hiding the 
> image.
>  Press the button again and the next image does not "hide".
>
> So I opened the Properties of the button, and then noted on the Editing
> scrolling button that there is an object "Image Holder" that is never 
> killed.
>
> I was under the impression that this use of "create" did not 
> permanently
> store an object.
>
> What can I change?
>
> Thanks,
>
> Jim
> _______________________________________________
> 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