Page 1 of 1

Training Day example doesn't include graphics?

Posted: Fri Feb 19, 2010 12:15 am
by Timpraetor
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

Re: Training Day example doesn't include graphics?

Posted: Fri Feb 19, 2010 1:19 am
by BvG
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.

Re: Training Day example doesn't include graphics?

Posted: Fri Feb 19, 2010 8:56 am
by DougN
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."

Re: Training Day example doesn't include graphics?

Posted: Fri Feb 19, 2010 5:27 pm
by Timpraetor
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

Re: Training Day example doesn't include graphics?

Posted: Fri Feb 19, 2010 9:43 pm
by bn
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

Re: Training Day example doesn't include graphics?

Posted: Sat Feb 20, 2010 8:38 pm
by InfoCentral
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?