I've created an object called "myObject" using the new()
command and attached it to a parent script ("Object Parent"). It
was then added to the actorList, so it would be "actorList," for
instance. There is also "actorList, actorList...." in the
In the "Object Parent" script, I've defined two properties:
1) a "spriteNum" property to connect actorList to a
particular sprite in a channel ("actorList.spriteNum")
2) a "state" property with the state being "on" or "off".
Each object in the actorList (i.e. "actorList,
actorList....") has it's own .spriteNum and .state property.
What I'd like to do is be able to click the sprite in the
channel that is associated with actorList and change the "state"
property to "on" or "off".
How do I get the sprite in a channel that is
"actorList.spriteNum" to refer to object "actorList," so I
can change it's property? I can't figure out a syntax for refering
an object from it's property, which is the reverse of the usual.
This sounds unstable and difficult to maintain. If your
script instances refer to particular sprites, what advantage does
your system have over attaching a behavior to each sprite?
The principle purpose of the actorList is to send a
#stepFrame event to each instance it contains, once per frame. Does
your system use #stepFrame? If not, then there are better solutions
to using the actorList. If your system does use #stepFrame, then
there may be good reasons to use #enterFrame instead, as this
improves performance; in which case also there are better solutions
than using the actorList.
If you describe what you are trying to achieve, rather than
how you are currently trying to achieve it, we may be able to
provide you with a simpler solution.