Free ActionScript

Home

AS3 Scripts

AS2 Scripts

Resources

About

Contact

Here is a simple Flash BitmapData class example; How to attach bitmaps and center them inside their holder container movieclip.

Using bitmap images instead of vector shapes is a great way to increase performance in your flash games. Preview

Download Fla Sample

nice, it is usefull for flash websites too!

No way to clear the bitmaps?

GeorgeC,

Since bitmaps are being attached directly to _root, you could loop thru all objects on _root and remove them.

Another way is to add all new bitmaps to an array. Once you want them all removed, you could loop thru that array and remove them.

Thanks. OK, I have fixed that problem. However I have a new one. Because the bitmap’s depth is highest on _root I cannot put an MC above the bitmap. I am using this for a blood splat effect where the player is above the blood but I’m finding it really difficult. And when I swap depths with mc and mc(nested?:bitmap) it only works for the first bitmap not all of them.

btw it’s a mixture of this and the multiple enemies code, with my edits. Thanks you so much for these.

I would approach your problem a little differently.

Instead of putting all your objects (player, enemies, blood splatter, bullet holes) in to one container, I would split these up.

Create a container for each one of these (and perhaps an array per container that holds all these objects):

Sky (clouds, smoke, etc) Player (you want the player to always be on top) Enemies Effects (blood, bullet holes) Ground

Hope this helps. PR

You must be logged in to post a comment.

AS3 Effects

AS3 Gadgets

Game Examples AS2 Effects Animated Effects Dynamic Enemy AI Game Engine Game Weapons Images Interface Math Security

Effects Animated

Effects Dynamic

Enemy AI

Game Engine

Game Weapons

Images

Interface

Math

Security

Game Examples AS3 Basics Bitmap Blitting Collision Detection Enemy AI Movement Physics Space Shooter User Interface Weapon System

Basics

Bitmap Blitting

Collision Detection

Movement

Physics

Space Shooter

User Interface

Weapon System

Site Updates

718Hosting.com

Actionscript.org Forums

Flash Game Blogs

Flash Game License

Flashkit Forums

gotoAndLearn

IndieGames.com

Kirupa’s Tutorials

Kongregate Forums

MochiAds Resources

Philip Radvan

Photon Storm

Polygonal

Radvan Media

Tonypa’s Tutorials

Register

Log in

Entries RSS

Comments RSS

WordPress.org