Subj : Executing a Function from within a script To : netscape.public.mozilla.jseng From : eboli@hotdak.net (Joseph Smith) Date : Sun Nov 16 2003 03:59 am Hey, I am new to using spidermonkey and am wondering if anybody can help me or knows of any good tutorials / source that will allow me to execute a function from within a script, or modify the properties of an object from my application. What i mean by this is that i have a file map.js for example: function Vector(x, y, z) { this.X = x; this.Y = y; this.Z = z; } DefaultVector = new Vector(0,0,0); NewVector = new Vector(1,0,0); function OnLoad() { Engine.PlayerVector(DefaultVector.X, DefaultVector.Y, DefaultVector.Z); } function OnSomething() { Engine.PlayerVector(NewVector.X, NewVector.Y, NewVector.Z); } function OnClose() { Engine.PlayerVector(DefaultVector.X, DefaultVector.Y, DefaultVector.Z); } .... etc where they are called in an event style fashion (ie on a map loading, closing, or as something is triggered from within the engine) So i am wondering how to go about this, i can use spidermonkey to script interactions with application objects, however havent found any tutorials / source to do this. Can anybody help me ??? Thankyou .