Skip to main content
Known Participant
February 4, 2014
Question

File or Folder does not exist

  • February 4, 2014
  • 1 reply
  • 1279 views

I'm having a wierd problem with a png image which generates an error in my script.

I'm building a UI using the group constructor, here is the line code I'm using to load the image:

myImg:Image{text:'',image:'(image_folder)/image.png', alignment:['left','top']}

The script runs with one image but not another one which is also a png of the same dimensions, bit depth etc. For some reason I get the 'file or folder does not exist' error message. If I replace the image with a known good one the script works.

I've re-generated the image a dozen times. Still no joy.

I'm not a total noob, though I infrequently write scripts and am completely prepared to learn I've made totally maverick error.

Any thoughts?

This topic has been closed for replies.

1 reply

Legend
February 4, 2014
myImg:Image{text:'',image:'(image_folder)/image.png', alignment:['left','top']}

I'm assuming that "(image_folder)" is a placeholder or variable and you are concatinating for the file path to the image? When checking file paths for images or what not, I usually try...

alert(File.decode(File.openDialog()));

...to verify that my path is correct. Sometimes there's a extra slash or something I am missing.

Known Participant
February 4, 2014

Thank you David. This is very helpful. I've learned a great deal from your video tutorials.

What I'm seeing is very odd, since the 'bad' image resides in the same path as the 'good' and won't load while the 'good' one loads.

I used the code you suggested which returns the path and its the same one in the code, though after selecting it in the file open dialog it loads in the UI.  Very strange.

Legend
February 4, 2014

I used the code you suggested which returns the path and its the same one in the code, though after selecting it in the file open dialog it loads in the UI.  Very strange.

That is strange. Maybe there is a issue somewhere on a line nearby and it's tripping the image element? I've had issues with quotes not being straight quotes before as well. Smart quotes can get implimented easily if copy and paste is used from outside your IDE. Doesn't hurt to double check that as well.