Hi Andrew,
What you are trying to do is create an object at runtime. In addition to
setting the member and location to the sprite, you need to make the "puppet"
property of the sprite to "True". This will make the sprite stay appeared on
the screen. Check out the "Puppet" property in the help.
You can have a look at the code below for details.
<code>
-- this handler puts the sprite on the stage
on putSprite me, lsInitMember, lnLoc, lnInk
pnSpriteNum = getChannelNum() -- get the empty channel
sprite(pnSpriteNum).puppet = TRUE
sprite(pnSpriteNum).member = lsInitMember
sprite(pnSpriteNum).ink = lnInk
sprite(pnSpriteNum).loc = lnLoc
end
-- this handler gets the empty channel to place sprite
on getChannelNum
repeat with lni = 1 to 1000 -- this loop starts searching for empty
channels from 400 to 1000
if sprite(lni).member.memberNum = 0 then
return lni
end if
end repeat
alert "OUT OF CHANNELS"
end
</code ends>
HTH.
Sandy.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of SOUTHERN Andrew
Sent: Saturday, November 10, 2001 4:34 AM
To: '[EMAIL PROTECTED]'
Subject: <lingo-l> newbie questions galore
Hey All,
Looking for net resources to help me grow with Lingo and Director 8, and
came across your group so I thought I'd join.
I can usually sort out simple problems myself, but I've got this little
glitch in my one frame movie that I can't work out.
I've got a routine that gives a free sprite channel a member number and
position, I know from the message box ("put sprite(15).locV or LocH or
member") that the data goes in to the channel. It even appears for a split
second on the screen, but I can't for the life of me work out how to make it
stay.
I could "Cheat" and have a dummy member in the sprite channel already, but
that doesn't look too neat to me, Can anyone tell me what I'm doing wrong???
-AS
[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!]