Path: utzoo!utgpu!attcan!uunet!seismo!sundc!pitstop!sun!DATJN@NEUVM1.Bitnet From: DATJN@NEUVM1.Bitnet (Jakob Nielsen Tech Univ of Denmark) Newsgroups: comp.sys.mac.hypercard Subject: How can I get instance variables in buttons Message-ID: <77053@sun.uucp> Date: 10 Nov 88 21:50:44 GMT Sender: news@sun.uucp Distribution: comp Lines: 33 Approved: hyper-hackers%plaid@sun.com I would like to be able to associate values with buttons (e.g. a list of when it has been clicked, a pointer to a special card field which would be different for each button, a text string different from the name, etc.). As far as I can see, the only place I can put such info is in the button script, and I have hit upon the following solution which is not very clean (since I want to be able to access the instance variables from scripts higher up in the object hierarchy): The button script contains: on mouseUp instanceVarIdea -- start the script which tries out the idea end mouseUp on myText -- the instance variable "myText" global dummyParameter -- used to communicate the result of the instanceVar put "This is some text" into dummyParameter end myText --------------------------- The stack script contains: on instanceVarIdea global dummyParameter send myText to the target -- calling the instance variable put dummyParameter into msg box end instanceVarIdea Do anybody have ideas for a cleaner way to program this??