How to use customProperties

Reinhold Venzl-Schubert r.venzl-schubert at t-online.de
Tue Feb 28 09:27:12 CST 2006


Hi!

I created a small substack to use it as a modal dialog.

In the MetaTalk Reference I found this:

If information must be returned to the handler that executed the  
modal command, set a custom property on the stack and check that  
value after the modal command.

- - - - - - -

Now I discribe the steps and scripts I want to do and did and hope  
you will tell me what is wrong, because it don't works:

1. I will import the image "horse.img" in a card of my mainstack. It  
shall get a new name and a corresponding script. There are already  
some other images "ImgQuestion1"," ImgQuestion2", "ImgAnswer1" in my  
card. The new shall get a different name.

2. I put the name "horse.img" into the container (variable)  
 >ImportImage< and the names of the almost present images into the  
container >ImageCollector>. Than I will send them to the modal  
subsatck. I don't transport images but only their names!

3. In the modal substack I consider the almost present names and  
choose the new imagename "ImgAnswer2".

4. Than I will send the name "ImgAnswer2" back to the mainstack.

5. There I import the image "horse.img" and give it the new name  
"ImgAnswer2". That's it!

- - - - - - -

To realise this I manually created two "New Property..." in "Custom  
Props..." of "Stack Properties".
I called them ImgCollectorProp and ImgImportProp.

Than I wrote this script in the corresponding button in the mainstack:

     set the ImgCollectorProp of me to ImportImage
     set the ImgImportProp of me to ImageCollector

     modal stack "ImageTypSelector"

Than I put the following script into the stackscript of the substack  
and into the cardscript:

on openCard  #on preopenStack

   get the ImgImportProp of stack "Karten"
   put it into fld "Imgname"
   get the ImgCollectorProp of stack "Karten"
   put it into fld "ImgList"

end openCard  # end preopenStack

- - - - - - -

The modal stack arise as wanted, but the fields "Imgname" and  
"ImgList" keep empty.

You may smile, but that's my first trial with customProperty

:-)
Reinhold


More information about the metacard mailing list