Training Day example doesn't include graphics?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Timpraetor
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9
Joined: Thu Feb 04, 2010 7:12 pm

Training Day example doesn't include graphics?

Post by Timpraetor » Fri Feb 19, 2010 12:15 am

Hi Folks,

I've taken the plunge and am learning to speak English again. I've been working through the Training Day Kiosk tutorial and I'm getting the hang of things pretty well. However, when I build the standalone version of the project for any platform, everything is working except there are no images included aside from the images imported as controls (the header and the main stack backdrop).

I've checked the standalone app settings and I do have the build set to "Search for required inclusions", and anything that was imported is there (sounds, header, background, detail icon), but the disk-based images for the 6 products are missing. Also, everything runs properly within the IDE.

Any thoughts? I'm working with the latest CD Contents from the sessions.

Thanks,
Tim
--
Tim

Tim Jones
President / CTO
TOLIS Group, Inc.
http://www.tolisgroup.com
http://ww2.productionbackup.com

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

Re: Training Day example doesn't include graphics?

Post by BvG » Fri Feb 19, 2010 1:19 am

Some stacks use images from the build in image library. If you do not manually place those images onto your own stack, most of those will not be part of the standalone. Some will be included because they're part of the answer dialog. Look at the images in the library by going to the menu "Development" -> "Image library". There's a button saying "place Image" there.

Another problem is referenced images. Those are not imported into a stack. This is because they are only linked from the hard disk, and your standalone might look at the wrong file path to find them. That is the case when their "fileName" property is set to a path. It's called "Source" in the "Basic Properties" part of the property inspector.
Various teststacks and stuff:
http://bjoernke.com

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

DougN
Posts: 20
Joined: Wed Mar 04, 2009 4:09 am

Re: Training Day example doesn't include graphics?

Post by DougN » Fri Feb 19, 2010 8:56 am

Tim,

I haven't worked through that tutorial, but my guess is that you've got images in the stack that are referenced, meaning that Rev is looking for them on your drive. It does this both when you're working in the IDE, and then again at runtime. Unfortunately, the path to the image when you're working in the IDE isn't the same as the path to it at runtime from the standalone... and so Rev doesn't show the image.

As I understand it, the "Inclusions" item you mention when you build the standalone doesn't include the referenced images (although it sounds like it should).

To get around this problem, you can either import all your images as controls, in which case they become part of the stack, or you can set up a folder system that you know the standalone will also follow and then reference them using a relative reference. For example, you put the images in an "images" folder that's at the same level of the stack you're building. There's still some code you need to include in the stack to tell Rev how to resolve the images... and I don't have that at hand right now.

You'll have the same issue with audio files that you reference with players, rather than importing into the stack directly. It's confusing and I don't know if there's a good visual explanation on it anywhere. But you can search the forum for other explanations using words like "relative" and "player."

Timpraetor
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9
Joined: Thu Feb 04, 2010 7:12 pm

Re: Training Day example doesn't include graphics?

Post by Timpraetor » Fri Feb 19, 2010 5:27 pm

DougN wrote:I haven't worked through that tutorial, but my guess is that you've got images in the stack that are referenced, meaning that Rev is looking for them on your drive. It does this both when you're working in the IDE, and then again at runtime. Unfortunately, the path to the image when you're working in the IDE isn't the same as the path to it at runtime from the standalone... and so Rev doesn't show the image.
But the original files are still in the same location as when I was building the project. What would have changed to cause that to become a missing, or invalid, path?
As I understand it, the "Inclusions" item you mention when you build the standalone doesn't include the referenced images (although it sounds like it should).
Agreed - that's a bit "non-intuitive" since the build setting implies that the referenced items will automatically be located and copied into the standalone app.
To get around this problem, you can either import all your images as controls, in which case they become part of the stack, or you can set up a folder system that you know the standalone will also follow and then reference them using a relative reference. For example, you put the images in an "images" folder that's at the same level of the stack you're building. There's still some code you need to include in the stack to tell Rev how to resolve the images... and I don't have that at hand right now.

You'll have the same issue with audio files that you reference with players, rather than importing into the stack directly. It's confusing and I don't know if there's a good visual explanation on it anywhere. But you can search the forum for other explanations using words like "relative" and "player."
So for small apps where there's no opportunity for making runtime changes to the referenced files, the smart move is to import as a control and not worry about referenced items.

Might be a good idea for future presenters to further define this implementation characterstic.

Thanks for the guidance.

TIm
--
Tim

Tim Jones
President / CTO
TOLIS Group, Inc.
http://www.tolisgroup.com
http://ww2.productionbackup.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4002
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Training Day example doesn't include graphics?

Post by bn » Fri Feb 19, 2010 9:43 pm

Tim,
did you check the "Copy Files" in the standalone application settings? Than include all the referenced images and sounds your stack needs. Than these files are included in the standalone. On the Mac in a file inside the the application bundle folder (the "file" yourApplication.app is actually a folder, control click on it and choose "show package content") Inside this "package" -> folder contents -> MacOs -> are your included files. Usually this should be transparent once you have included the files with "Copy Files".
Another way is, as pointed out by BvG, is to provide a known folder where your media files should be stored, look at specialfolderpath in the dictionary to get a path to for example the documents folder, you than can point the player to files inside a folder of this known folder.
I don't think it is a very good idea to import all these media types into your stack, they are all loaded into Ram.
regards
Bernd

InfoCentral
Posts: 90
Joined: Thu Feb 11, 2010 5:14 am
Location: Los Angeles

Re: Training Day example doesn't include graphics?

Post by InfoCentral » Sat Feb 20, 2010 8:38 pm

Timpraetor wrote: I've been working through the Training Day Kiosk tutorial and I'm getting the hang of things pretty well.
Where do you download that tutorial?
"I am an Apple user and whatever they tell me I know it is for my own good and for the good of the collective..."

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”