2009.11.18

TAT Augmented Reality Demo

By underblob @ 1:20pm — Categories: Mobile, Tech, Video
Tags: , , ,

This mobile app by TAT uses facial recognition and social networks to present a layer of augmented reality over visual/video displays. Check it out:

YouTube Preview Image

Links

TAT.se
wikipedia/Augmented_Reality

2009.11.17

AS3 Naming and Retrieving Elements Dynamically

By underblob @ 3:51pm — Categories: Flash
Tags: , ,

Recently ran across this problem in Actionscript 3 with dynamically naming and retrieving child elements. Created a loop to name sprites and add using the name property and addChild method:

for ( var i:int = 1;  i <= 3;  i++ ) {
	var bkgd:Sprite = new Sprite ();
	bkgd.name = "bkgd" +i;
	addChild ( bkgd );
}

 

Now these sprites are accessible via getChildByName and are retrieved as DisplayObject by default. But when retrieved as DisplayObject, you can not add children via addChild method. The trick is to cast the DisplayObject as a Sprite:

var addBkgd:Sprite = Sprite ( this.getChildByName( "bkgd" +layerNum ) );
addBkgd.addChild ( layerSprite );

 

hexbkgd