Two Questions from a newbie about Pathnames and Graphics

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
Brian
Posts: 2
Joined: Sun Jan 27, 2008 4:55 pm

Two Questions from a newbie about Pathnames and Graphics

Post by Brian » Tue Jan 29, 2008 4:34 am

Hi
1. Pathnames: I have an images, video and audio folders inside the file that holds the stack referencing them but buttons don't seem to be able to find the files unless I use a complete address: /usr/desktop/folder/file/subfile...

Can I shorten the pathway (ex: .../images/file) so my Rev stack can find the resources? I don't see how it will work the way I've got it when compiling...

2. Graphic imports - I've created some graphics for buttons but I'm doing something wrong. I've imported them into the Image Library, I've identified them as external resources ... Eventhough they images are on several cards, if I delete the first image I imported... all the images are deleted on all the cards. What am i doing wrong...

Thanks!

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

Post by BvG » Tue Jan 29, 2008 4:47 pm

1. look up the defaultfolder property in the documenation (it's all in there, even if hard to find ;) )

2. I am not sure what you mean, but there's two ways to work with images:

A. reference them on the hard disk, this has the advantage that they are not all loaded at once when opening the stack. Recommended for big images and/or imageviewer-type applications.

B. importing them into the stack. this way you do not need the image files anymore as they are now embedded in the stack itself.

I guess you used B, and then used the icon property of buttons to show that image. The icon property of buttons works quite similar like A. only that it's not a file it points to, but the original image object (no matter if it's content is referenced or imported). So if you delete the original image object, none of the icons in buttons pointing to that will work anymore.

I also advise to not use the image library. It adds unnecessary clutter to your stack, which you can't control yourself. Instead, have a stack or card which you never show, and use that as your own, private image library. Another approach is to just hide images that are not supposed to be seen by the end user, the icons of buttons will still show correctly then.
Various teststacks and stuff:
http://bjoernke.com

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

Brian
Posts: 2
Joined: Sun Jan 27, 2008 4:55 pm

2 questions

Post by Brian » Tue Jan 29, 2008 8:16 pm

Thanks very much for the guidance. I really appreciate the speedy reply!

I have this feeling, that I'll be asking a few more questions before I'm through :D

Post Reply