Michael,

> But what, if I have the name of the property in a variable? Like
> 
> myProp = symbol(pSomething)
> 
> Writing
> 
> me[myProp] = 1
> 
> doesn't work,

Hmmm, seems to work for me in a behavior. For example, I attached the
following behavior to a sprite:

property pFoo

on beginSprite (me)
  pFoo = 5
end

on setProperty (me, aProp, aVal)
  me[aProp] = aVal
end

on getProperty (me, aProp)
  return me[aProp]
end

The in my Message window:

put sprite(1).getProperty(#pFoo)
-- 5
sprite(1).setProperty(#pFoo,15)
put sprite(1).getProperty(#pFoo)
-- 15

So I'd say it's working on my end, are you doing something different? Is
this a behavior or a parent script? Does it work for you in simple test
cases?

Director MX 2004 (10.1.0r11), WinXP Pro SP2

Cheers,
Tom Higgins - Technical Product Manager
Macromedia Director and the Shockwave Player
http://weblogs.macromedia.com/thiggins/

... 

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[email protected]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to