Setting a property on a different card

Klaus Major klaus at major-k.de
Wed Mar 16 12:05:06 EST 2005


Hi Len,

> I have a little app that uses a setup stack (the main-stack) and an 
> "ID Card" stack where I have a single card with the layout of an 
> employee badge.  If I load an image by hand, it works fine.  I am now 
> trying to to print a batch of these badges on one sheet.  I can change 
> the contents of the text fields that hold the name, title, etc. with 
> no problem but I'm having trouble setting the file name for the image 
> (they are stored in a separate folder on a shared drive.
>
> My code is:
>
> set the fileName of empPhoto of card 1 of stack "ID Card" to 
> "I:/Photos/00677-180.jpg"

i do not see the descriptor "image" here?

So maybe this will work:
set the fileName of IMAGE "empPhoto" of card 1 of stack "ID Card" to 
"I:/Photos/00677-180.jpg"

Presumed "empPhoto" is the NAME of the image, don't forget the quotes!

> This gives me an error with "no 'to'".  This same approach works fine 
> with "put" on the text fields (even going to a card on another stack).
> What am I missing?  The documentation I've found doesn't seem to show 
> how to do this across stacks - just the current stack.

It is the same with other stacks!
As long as you provide the looooong descriptor it ill work! :-)

set the fileName of image "myPhoto" of card 14 of stack "Stack name 
here" to "I:/Photos/00677-180.jpg"

Even if you do this from another stack!

> I'm having one additional problem with this little app when I start it 
> up:  As I said above, there is a main stack and a substack.  There is 
> a PRINT button on the main stack that causes the "ID Card" stack's 
> single card to print.  The problem I'm having is the first time I try 
> this, I get an error saying the card has to be opened before I can 
> print it.  If I open the Application Browser and double click on the 
> ID Card line (which displays it on the screen), then I can go back and 
> press the PRINT button and all is fine.  I have a preOpenStack handler 
> on the main stack the has "start using stack "ID Card" on it but that 
> doesn't seem to do the trick.  Any ideas?

No, sorry...

But maybe the card really HAS to be open/visible?

> Thanks in advance
>
> len morgan

Regards

Klaus Major
klaus at major-k.de
http://www.major-k.de



More information about the use-livecode mailing list