Australian Made and Owned

Removing MovieClip Children from MovieClip in Flash Using ActionScript

The Problem

While working on an update for Once Upon a Bride’s handmade jewellery website, I had to overcome a certain bug or problem in Internet Explorer that caused images loaded into Loader Components to render incorrectly and scale incorrectly, usually with incorrect width and height. This was occurring after loading about 12 - 15 images.

So instead of loading them all at once, I made it load only eight images, and let the users view a page of eight at a time. The only problem I had was clearing the old thumbnails before loading the new ones.

The Solution

The Solution After a bit of looking around, here’s the code:

function clearMovieClips(parentMovieClip) {
	for (obj in parentMovieClip){

		if (typeof(parentMovieClip[obj])=="movieclip"){
			parentMovieClip[obj].removeMovieClip();
		}
	}
}

The Proof

Now a nice before and after shot:

Before:

Once Upon a Bride - Before

 

After:

Once Upon a Bride - After



Did you like this post?
Email Send to a friend Add to Technorati Favorites

AddThis Social Bookmark Button
AddThis Feed Button

Leave a comment

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URL