Page 1 of 1

showing a picture

Posted: Tue Aug 26, 2008 5:54 am
by Glenn Boyce
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

Posted: Tue Aug 26, 2008 8:23 am
by Mark
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