65 to 530 to 65 solved

miscdas at boxfrog.com miscdas at boxfrog.com
Thu Apr 17 07:26:01 EDT 2003


Shari writes: 

> finally wrote the following (very fast) handler to import all those 
> images: 
> 
> on importImages
>   put the effective filename of this stack into imageList
>   set the itemDel to "/"
>   put "Images/TerrainOutdoors" into the last item of imageList
>   set the itemDel to comma
>   set the directory to imageList
>   get the files
#############################
>   repeat for each line x in it
>     import paint from file (imageList & "/" & x)
>   end repeat
>   repeat with x = 2 to the number of images
>     set the visible of image x to false
>   end repeat
###################################
> end importImages
============== 

If I understand correctly the marked section, you import images in a repeat 
loop, then execute a second repeat loop to hide all of them except the first 
image. 

Wouldn't it be faster to run only one loop, like the following? 

  repeat for each line x in it
    import paint from file (imageList & "/" & x)
    set the visible of image x to false
  end repeat
  set the visible of image 1 to true 

Also, is there any speed difference between 

  set the visible of image x to false 

and 

  hide image x 

? 

miscdas 



More information about the metacard mailing list