Categories
AS3

AS2 to AS3: get all objects in a movieclip

Sometimes you want a list of everything inside a movieclip. For example: you want to know the instance names of every movie in the root.

ActionScript 2

A little trick that I used a lot in AS2 is:

for(var i in _root){
   trace('key: ' + i + ', value: ' + _root[i]);
}

or

for(var i in target_mc){
   trace('key: ' + i + ', value: ' + target_mc[i]);
}

to find out which movies are in target_mc

It was not only a trick to trace everything, I also used it to reset movieclips (place them outside the stage, or delete them) or quickly make buttons out of them:

for(var i in target_mc){
	target_mc[i].id = i;
	target_mc[i].onRelease = function (){
		trace ("id = " + this.id); // onRelease the id will be called (the name of the movie)
	};
}

ActionScript 3

But in AS3 this doesn’t work any more!
And I know: AS3 should make my life easier…. well if I see the solution to the problem created by AS3, I have to disagree!

for (var i:uint = 0; i < target_mc.numChildren; i++){
	trace ('\t|\t ' +i+'.\t name:' + target_mc.getChildAt(i).name + '\t type:' + typeof (target_mc.getChildAt(i))+ '\t' + target_mc.getChildAt(i));
}

In AS3 you first have to get the "number of children" (numChildren) in a DisplayObjectContainer, then you have to say which child you want (getChildAt(i))...
A good thing about AS3 is, you get everything in a movieClip, even shapes you made there without a instance name.

I'm glad that I work with FlashDevelop, which has snippets so I don't have to type this constantly!

(For the people that use FlashDevelop too, here is my snippet:)

// $(Clipboard)is a DisplayObject
trace ('+ number of DisplayObject: ' + $(Clipboard).numChildren + '  --------------------------------');
for (var i:uint = 0; i < $(Clipboard).numChildren; i++){
	trace ('\t|\t ' +i+'.\t name:' + $(Clipboard).getChildAt(i).name + '\t type:' + typeof ($(Clipboard).getChildAt(i))+ '\t' + $(Clipboard).getChildAt(i));
}
trace ('\t+ --------------------------------------------------------------------------------------');
Categories
Design Urban papercraft

Urban papercraft: Macula

Another artist in the PaperToy book created by Matt Hawkins is Macula

Macula = Christopher Bonnette and he has a fascination for mythology and folklore.
Inspired by these myths/folklore, he create some paintings:
Krampus Painting

But he created not only paintings but also a paperToy series named: Squealer
This model is called Krampus:
Krampus

There are different kind of skins:

KrampusKrampusKrampusKrampus

(you can’t click on these images and download: visit the site yourself)

But has created some other models to:

tikiboxyeti

You can see the complete Squealer series in the Squealer gallery (of view Krampus directly).

And there is also a blank version to customize:
squealer

Just visit the site and click on the blank squealer, or follow this link.
There are also some building instruction.

Categories
Design Urban papercraft

Grim Grinning Grunt – a HedKase custom part 2

Update #1: There is also a review of this model on paperkraft.blogspot.com go check it out!

A little update after my last post about Grim Grinning Grunt.
a [mck] custom

You can now download the custom hedKase on the site of NiceBunny!
And with a little help from yours truly it’s now possible to link directly to a specific model: so to view my custom HedKase: Grim Grinning Grunt download the model and enjoy!

NiceBunny site