on showInfoInMessageWindow(me, tObject) timeOut().new("timer1", 2000, #showInfo, tObject) end
Run the movie
-- Message Window myObject = script("car").new("bmw", 200) myObject. showInfoInMessageWindow(myObject)
this results in 2 second delay flushing in Message Window.
Hi Peter,
It seems to me that there is some confusion in your code...
First, you create a new timeOut object every stepFrame. Thankfully, you have not appended your object to the actorList (which triggers stepFrame events), otherwise your script could create all sorts of weirdnesses!
Second, it is good practice to do your own garbage collection. I mean that if you instantiate an object, it is worthwhile explicitly killing that object yourself in order to avoid any memory leaks. Have a look at the "forget" command in relation to timeOut objects.
You might like to try something like:
-- Parent script "car" property name property velocity
on new(me, tName, tVelocity) name = tName velocity = tVelocity return me end
on destroy(me) -- kills the timeOut object if it exists timeout("timer1").forget() end
on showInfo(me) put ("My name is") && name put ("My velocity is") && velocity end
on showInfoInMessageWindow(me) -- you don't have to pass your object ref - it is already "me" timeOut().new("timer1", 2000, #showInfo, me) end
Run the movie
-- Message Window myObject = script("car").new("bmw", 200) myObject.showInfoInMessageWindow()
-- and now to dispose of the object myObject.destroy() myObject = VOID
hth, Chris
[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!]