Remember to use nextFrame() when adding code and shapes to SWFSprites

May 2, 2006

In Ming, when working with SWFSprite objects (i.e. Flash MovieClips), you will often want to add in code and shape data to the sprite. When doing so, remember to “commit” the additions you make by calling nextFrame(), else nothing will appear. So, in Python, you would do something like:

clip = SWFMovie()
clip_shape = SWFShape()
clip_action = SWFAction("this.foo = bar;")
clip.add(clip_action)
clip.add(clip_shape)
clip.nextFrame()

Thus the additions get properly “saved” into the object. This potential pitfall is also covered on page 4 of the Ming tutorial but it doesn’t hurt to have it written down twice.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: