> Thanx for your reply. I tried exactly the way u
> suggested and wrote this code:
> on startMovie
>   global x
>   x = script("SpriteTrackMouse").new()
>   sprite(2).scriptInstanceList.add(x)
> --  sendsprite(2,#SpriteTrackMouse, 1)
> end
>
> but it doesnt work...don know y..
> the problem is that i do not know what should the last
> entry in the sendSprite be, i mean what does it
> signify? when one drags and drops this behaviour from
> the library pallette on a spite it asks for setting 2
> parameters (that is center sprite on cursor or set
> within stage) ..how do i set the same when i call it
> thru lingo????

First up, you'll have to add an "on new me" handler to the script you want
to add. Inside this handler you'll need to initialize all the properties
that the script object needs to operate, including the props that get
configured by the GPDL handler. In the case of the library behavior you
mention, these would be:
pSprite, pStageBounds, pCentered and pLimited.

This handler might look like:

on new me, sNum, centered, limited
  pSprite = sNum
  pStageBounds = point(the stage.rect.width, the stage.rect.height)
  pCentered = centered
  pLimited = limited
  return me
end new

and you might instantiate and attach it like:
x = script("SpriteTrackMouse").new(2, TRUE, TRUE)
sprite(2).scriptInstanceList.add(x)

You will have to be careful about when you do this - there MUST be a
sprite(2) on the stage at the time, AND see below.

Secondly, AFAIK, you can only dynamically add to a sprite's
scriptInstanceList if there is already at least one behavior on the sprite.

HTH,
-Sean.


[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