Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create Sprite

15 views
Skip to first unread message

David Reis

unread,
Oct 9, 2001, 9:55:33 AM10/9/01
to
How I Can create a sprite dynamically ? I don´t want use the
"beginRecording" function...

Thanks

David Reis


Robert Tweed

unread,
Oct 9, 2001, 10:44:11 AM10/9/01
to
"David Reis" <david...@mind.pt> wrote in message
news:9pv067$n85$1...@forums.macromedia.com...

> How I Can create a sprite dynamically ? I don´t want use the
> "beginRecording" function...

Well you are looking at dynamic puppets which are undocumented and therefore
can cause some problems. The correct way to do it is to put the sprite in
the score in a hidden location, then change the member, loc and visibility
properties accordingly when you need to. Unfortunately this way you cannot
change the type of the member (so bitmaps and shapes cannot be mixed on the
same channel).

However, you can leave the plane empty, which allows you use whatever type
you like, but you are more likely to run into problems this way, and this is
what macromedia will tell you not to do, because it is undocumented and
unsupported. What you have to watch is that you set all the properties for
the sprite when you create it, otherwise you may end up with some properties
left over from a previous sprite. Do something like this:

spriteNum = 100
MyMember = member "thing" of cast "resources cast"
MySprite = sprite( spriteNum )

puppetSprite spriteNum, true
MySprite.member = MyMember
MySprite.width = MyMember.width
MySprite.height = MyMember.height
MySprite.loc = point( 100, 100 ) - Set to whatever the location is supposed
to be
MySprite.blend = 100
MySprite.Ink = 0
MySprite.Visible = true

When you want to "destroy" a sprite, just do something like this:

MySprite.ScriptInstanceList = []
MySprite.Cursor = 0
MySprite.Visible = false

Remember that this does not really destroy anything, which is why you have
to set all the properties again next time you need to use that channel. You
also need to keep your own list of which sprites are in use, because there
is no automatic way to tell. You can use lists to do this, I use a generic
object which I will post if you can't solve that problem yourself.

You should also be aware that if you need to jump to another frame in your
movie then all your dynamic sprites will override anything that is in the
score in your other frames. The easiest way around this is to keep
non-dynamic sprites in the low numbered sprite channels, and keep dynamic
sprites higher up, so there are no conflicts.

- Robert


contac...@yahoo.com

unread,
Apr 21, 2015, 11:40:26 PM4/21/15
to
Robert, I tried this and it works, but I can't seem to change the ink to anything but leave it alone in Copy, if I change it to let's say matte, it turns the image black, I tried setting the foreground and background color to white and black and it only inverses the image.............H.E.L.P

Manish Patel

unread,
Apr 23, 2015, 4:53:30 AM4/23/15
to
Post your question on http://listserv.uark.edu/archives/direct-l.html

Many people there will be able to help you out.
0 new messages