Reading in images with a standalone

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sketchpad92
Posts: 7
Joined: Tue Apr 28, 2009 6:33 pm

Reading in images with a standalone

Post by sketchpad92 » Thu Aug 27, 2009 2:05 pm

I am creating a program with about 100 image files. The way I have it set up is to loop through a list of filenames, setting the image to the specified filename on each iteration. When transferring to a standalone, the images are not showing up, presumably because the program is not accessing the files. If you add the file in the standalone settings panel, the image shows up, but this method is not particularly user friendly as it only lets you add one file at a time...making entering 100 or so onto that list rather tedious (especially when I am dealing with about 4 experiments of 100 images at a time). Is there another way for the standalone to be able to read the image files in? Perhaps I could do something from within the code that would allow it to access the files?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Thu Aug 27, 2009 2:21 pm

Like with your writing file question, this boils down to wrong filepaths. try to make a small test app with your filepath code put into a field instead of directly trying to access the file, and look where the problem could be. An example could be:

Code: Select all

on mouseUp
  put the effective filename of this stack into thePath
  set the itemdelimiter to slash
  put item 1 to -2 of thePath & slash into thePath
  --go url ("binfile:" & thePath & "data.rev")
  put thePath into field 1
end mouseUp
If you do not know how a correct path should look like, use the following code in the message box to see a path:

Code: Select all

answer file ""; put it
common problems:

- forgetting brackets around urls. the url will only work if it's all in one piece so the following won't work:

Code: Select all

put url "file:" & myPath into theVar
--correct would be:
put url ("file:" & myPath) into myVar
- using && instead of &: This has bitten me quite a few times... strangely i do not learn from that experience ;)

- missing slashes, or too many slashes. Again make sure your path is exact and correct.

- using existing paths that change when on another computer/directory/hard disk: If you hardcode the wrong parts of your path (for example always using "c:" then you might run into problems when the code is run from other locations.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

sketchpad92
Posts: 7
Joined: Tue Apr 28, 2009 6:33 pm

Post by sketchpad92 » Thu Aug 27, 2009 2:54 pm

So it seems....Thanks so much for your response. I've got it up and running now....It's been a long day :)

Post Reply