Page 1 of 1

Error and slow down of livecode (or my code ;-d)

Posted: Tue Sep 11, 2012 11:40 am
by fpierron
Hi,

I have noticed that each time I select another item in the interface (from button to another button) during the edit mode, the property inspector slow down and the style property panel changes many time very quickly (it seems it parses the list of style).

Maybe it is connected : i have a error message that pops up during run mode :

Code: Select all

The handler: focusOut has reached the recursion limit of: 400000.
Execution will be terminated to prevent hang
The message seems to be relative to an upload of an image from internet with a command :

Code: Select all

set the filename of image "img_article" to "http://mydomain.com/img_content/" & theDataA["Image"]
the name of the image is taken from the data grid.
It works but the script seems to try to get the filename when I open the card to edit it.

What would be the work around ?

Best

Frédéric

Re: Error and slow down of livecode (or my code ;-d)

Posted: Tue Sep 11, 2012 4:36 pm
by fpierron
Dear me,

I have found a solution. It came from the way I downloaded image with the filename command.

The code now is :

Code: Select all

on mouseUp
      global myURL
     put "http://mydomaine.com/img_content/" & theDataA["Image"] into myURL
      load URL myURL with message "myURL_loaded
end mouseUp

on myURL_loaded
   global myURL
   if the URLStatus of myURL is "cached" then
      lock screen
      set the filename of image "img_article" to myURL
      if the width of image "img_article"  > 312 then
         set the width of image "img_article" to the width of image "img_article" / 2
         set the height of image "img_article" to the height of image "img_article" / 2
      end if
      unlock screen
   else 
      put "cannot load image : " & the URLStatus of myURL into fld "fld_alerte"
   end if 
end myURL_loaded
load before and lock screen should be the keys...