l i v e c o d e

Setting Custom Properties From Within One
Mac OS 9 Mac OS X Windows Linux

NOTE: The tip below no longer applies to MetaCard 2.5/Revolution 2.0 or later. It was deemed a bug, and was fixed. The following tip still works, however, and so is left for those users of earlier versions of MC/Rev.

> Does anyone else have an opinion on the inability of rev/MC to activate
> a setProp handler from within one. I can understand not being able to
> activate the one your in but not being able to activate others sucks.
> It causes you to do stupid workarounds like using a handler when you
> really wanted to use a setProp.

Normally, you can trigger a setProp in another object; you just can’t trigger any setProps in the object you’re in. For example, suppose you had two buttons with the following scripts:

-- Button 1

setProp age
  answer "Age"
  set the lemon of button 2 to 1
end age

-- Button 2

setProp lemon
  answer "Lemon"
end lemon
			
If you do:
set the age of btn 1 to 10
You will get two dialogs: "Age" and "Lemon".

However, there is a workaround that will let you trigger another setProp in the same object... here’s the script:

-- Button 1
setProp age
  answer "Age"
  send "set the lemon of me to 1" to me in 10 milliseconds
  pass age
end age

setProp lemon
  answer "Lemon"
end lemon
			
If you do:
set the age of btn 1 to 10
You’ll get the same two dialogs: "Age" and "Lemon".

Hopefully this will be fixed in the next version of MC/Rev.

Posted 6/21/2002 by Ken Ray to the Use-Revolution List    (See the complete post/thread)


 Print this tip

News and Rumors Products Services Developer Resources Contact STS About STS