Hi all...
Anyone with any experience using setScriptList()? I checked the
archives and couldn't find a clear enough answer.
Below, I'm trying to make a sprite start off with just 1 behavior, out
of the 6 I have attached to it in the score. I save a list of all 6,
use just 1, and then I want to
try setting the scriptInstanceList instead:
sprite(1).ScriptInstanceList=[script(foo)]
or
sprite(1).ScriptInstanceList=[script(foo).new()] -- for initializing
some props in new handler
and also:
origScriptList = sprite(1).ScriptInstanceList
...
sprite(1).ScriptInstanceList=origScriptList
no, it's the other way round, script instances have properties, not
scripts.
just try:
behaviour script of sprite 1
property pTest
on beginSprite me
pTest=XXX
end
on mouseUp me
alert pTest
end
end behaviour script of sprite 1
and in the message window:
l=sprite(1).scriptInstanceList
Hey, thanks, Valentin. That works perfectly.
- Michael M.
[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
At 17:06 Uhr -0500 05.12.2003, Clay Atfield wrote:
Hello all,
I have been trying to attach a behavior dynamically to a sprite with the
properties of the behavior also dynamically added/changed using values from
a db at runtime. I've been using setScriptList and at first am having
wonderful success
Hello all,
I have been trying to attach a behavior dynamically to a sprite with the
properties of the behavior also dynamically added/changed using values from
a db at runtime. I've been using setScriptList and at first am having
wonderful success at attaching the behavior and setting it's
--Ok, This works fine for adding a behavior
On beginSprite me
sprite(7).setScriptList([[(member 8 of castLib 1), [#pConstrained:
0]]])
end beginSprite
--But, Shouldn't this remove it???
on endSprite me
(7).setScriptList([])
end endSprite
[To remove yourself from this list, or to
On Monday, Jun 30, 2003, at 15:06 America/Chicago, Matt Wells wrote:
--But, Shouldn't this remove it???
on endSprite me
(7).setScriptList([])
end endSprite
Not if you haven't specified that 7 is a sprite:
sprite(7).setScriptList([])
However, again, check this list's archives, Macromedia's