Code: Select all
-- context
switch me
case this me
break
case some other me
break
case not me
break
case knock knock
answer "who's there?" with banana
break
end switch
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark
Code: Select all
-- context
switch me
case this me
break
case some other me
break
case not me
break
case knock knock
answer "who's there?" with banana
break
end switch
Well, 'this script' would return an object reference - although I guess it might cause confusion as (at first glance) it might look like it returns the script that is executing (as in the text of the script), rather than a reference to the 'script object'. Perhaps 'the scriptObject' would be better - but it just seems a little clunky.The problem with this script is that the whole point is to get an object reference... That's why I originally suggested scriptObject.
I don't think 'the owner of my behavior' makes sense given the property we are trying to access. Here is why - the purpose of 'this me' is to get a reference to the actual object containing the script that is executing from within that script itself. 'the owner of my behavior' implies the following:Martin Koob wrote:the owner of my behavior -> would return the button containing the behaviour script if it is a behavior, or the object itself if the control does not have a behavior.
I've been thinking that the <whatever> property would be used from within the behavior script.I read this as a property you would use from the script that has a behavior assigned to it, rather than within the behavior script itself.