> Doesn't saving a movie recompile? At least in authoring, there are
> alerts if the are script errors. Doubtful at runtime- they probably
> don't do that sort of check- easy enough to test though.

I think saving does re-compile all scripts, but I'd rather not save -- even
though my code for multiple undo's works flawlessly ;) -- I'd rather not
force the end user to save their file after my software has gone through and
altered every script castmember.

Incidentally, the recompile isn't really necessary to run the scripts (it
would just look nicer than going through and hitting tab on each edited
script). My original post was probably named incorrectly. Constructing
scripts from strings, then setting the string to be the scripttext of a
member seems to work fine for creating executable code. For example, this
will work to create an object instance

on createScript 
  str = ""
  str = str & "on new me" & return
  str = str & "return me" & return
  str = str & str & "end" & return
  str = "" & return
  str = str & "on mBarrack me" & return
  str = str & "alert " & QUOTE & "Kick it long to Richo" & QUOTE & return
  str = str & "end"
  -- 
  tempMember = new(#script)
  tempMember.scripttype = #Parent
  tempMember.name = "TEMP-SAFE TO DELETE"

  tempMember.SCRIPTTEXT = STR <-- this seems to cause a compile of this
script (since script errors will get reported)


  -- create instanced
  ObjInstance = script(tempMember.name).NEW()
  erase tempMember
  -- test instance
  ObjInstance.mBarrack()
end 

(I got onto this a while back while experimenting with creating little
'virus-like' objects which could 'eat' other objects to gain handlers from
their prey. Despite much experimenting, I couldn't get any emergent
self-aware intelligence, alas :)

Luke


[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!]

Reply via email to