Right.  Actually, just as a minor tweak, I would do it this way:

property spriteNum  -- automatically is given the correct number when 
dropped on a sprite

on beginSprite me
   theList = ["303", "303a"]
   ran = random (theList.count)
   sprite(spriteNum).member = theList[ran]
end

No need for the exitFrame script here.  Instead, use a seperate frame 
script that says:

on exitFrame me
   go to the frame
end

Save the first script into a behavior script, then drag it from the 
cast onto the sprite in channel 1.
Save the second script into a behavior script, then drag it into the 
frame channel of the score.
As Buzz said, these are both behaviors.

Irv

At 6:14 PM -0300 10/28/01, Agust�n Mar�a Rodr�guez wrote:
>Irv was saying that he would do it this way:
>
>on beginSprite me
>   thelist=["303","303a"]
>   ran=random (thelist.count)
>   sprite(me.spriteNum).member = thelist[ran]
>end
>
>on exitFrame me
>   go to the frame
>end
>
>This would have be a behavior script rather than in a frame script 
>(see the type
>in the inspector). And it goes attached to the sprite.
>
>That should work fine
>
>
>Mel Kloscheim wrote:
>
>>  Irv and Agustin, thanks for your answers .
>>  I don't understand how to use the spriteNum? Everytime I go to that frame
>>  I would like the random of two or three bitmaps. Are you saying there is
>>  someway
>>  I can attach a behavior to a sprite to do the same thing. I don't understand
>>  how.
>>
>>  Mel
>>
>>  Agust�n,
>>
>>  There is nothing wrong with having a beginSprite handler in a frame
>>  script.  The beginSprite only gets called once, whereas the exitFrame
>>  handler is called continuously.  I do this all the time.
>>
>>  If he were going to restructure this at all, I would suggest that he
>>  rewrite it to be a behavior using "spriteNum", and attach it to
>>  sprite 1, instead of having the frame script telling sprite 1 what to
>>  do.
>>
>>  Irv
>>
>>  At 5:08 PM -0300 10/28/01, Agust�n Mar�a Rodr�guez wrote:
>>
>>  Why are you using an on beginSprite handler on a frame script? That would be
>>  more aprropiate for a behavior script. Anyway.. it worked perfect this way.
>>
>>  Agust�n.
>>
>>  --
>>
>>  Lingo / Director / Shockwave development for all occasions.
>>
>>    (Home-made Lingo cooked up fresh every day just for you.)
>>
>>  [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!]
>>
>>  _________________________________________________________________
>>  Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>>
>>  [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!]
>
>
>[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!]


-- 

Lingo / Director / Shockwave development for all occasions. 
          
   (Home-made Lingo cooked up fresh every day just for you.)

[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