At 9:26 +0530 01_04_27, [EMAIL PROTECTED] wrote:
>Just a late thought Jakob...
>
>How can an object that is not added to the actor list be used in another
>movie?
The timeOutObject has a property "persistent" which when set to true
keeps the timeOutObject alive until explicitly forgotten.
> Do I use a global to point to to the behaviors instance? The
>timeOut, I guess, would keep it alive by referring to the objects
>handler(which does not exist, ofcourse).
The timeOutObject keeps the targetObject alive by referring to the
targetObject itself, not by referring to its handler. And as long as
the targetObject is "alive" it will exist along with all of its
handlers and properties.
>But what if I need to send a
>message to the object? How do I do that?
Well, you can refer to the "target" of the timeOutObject, but it
would probably be more convenient with some kind of global.
Below some scripts I used for some tests:
====<movie "timerTest">====
----<movie script: (member 1 of castLib 1)>----
on prepareMovie me
call #forget, (the timeOutList).duplicate()
script("testClass").new()
end
----</movie script: (member 1 of castLib 1)>----
----<parent script: testClass>----
on new me
tTimer = timeOut(me.string).new(500, #mTest, me)
tTimer.persistent = TRUE
end
on mTest me
put #test, me
end
----</parent script: testClass>----
----<score script: (member 3 of castLib 1)>----
on exitFrame me
-- go the frame
go movie "timerTest2"
end
----</score script: (member 3 of castLib 1)>----
====</movie "timerTest">====
====<movie "timerTest2">====
----<score script: (member 1 of castLib 1)>----
on beginSprite me
put #target, (the timeOutList)[1].target
end
on exitFrame me
go the frame
end
----</score script: (member 1 of castLib 1)>----
====</movie "timerTest2">====
Jakob
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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!]