showing a picture

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
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

showing a picture

Post by Glenn Boyce » Tue Aug 26, 2008 5:54 am

I want to select an item from a drop down list and show a picture

on mouseUp

create invisible image
set width to 181
set height to 166
set location to 770,463
set filename to "./../My Pictures/Bag Pictures/Pouches/pouch1.jpg"
set visible to true

end mouseUp

why doesn't this script work?

cheers

Glenn

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Tue Aug 26, 2008 8:23 am

Hi Glenn,

When you specify a property, you have to specify whose property you want to change. For example, if you want to change the textStyle of a field, you need to say which field:

Code: Select all

set the textStyle of field "My Field" to bold
If you want to change the width of an image, you also need to refer to that image correctly:

Code: Select all

set the width of image "Some Image" to 250
The problem is that you need to know how to refer to a newly created image. There are a few ways to do this.

After creating an image, the it variable contains a full reference to that image. So, you can do:

Code: Select all

create img
put it into myImg
set the filename of myImg to <path to file>
You can also refer to the last image.

Code: Select all

set the filename of the last image to <path to file>
The filename may also be wrong. I'd type

Code: Select all

answer filename ""; put it
into the message box to check it.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply