Query Graphics Data – Live demo

I wanted to post the demo of the example I posted the other day as a video. It is using the new Query Graphics API we are introducing in Flash Player 11.6/AIR 3.6. Make sure you have Flash Player 11.6 and check the demo below. Just click anywhere to sample the graphical objects from the MovieClip then reconstruct it at runtime:

Get Adobe Flash player

Here is the very simple code below, note that the API is now called readGraphicsData. You can download the full source code here:

package
{
	import flash.display.IGraphicsData;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	[SWF(width="900", height="400", frameRate="30", backgroundColor="#FFFFFF")]
	public class TestGrabby extends Sprite
	{
		private var b:BigBilbo = new BigBilbo();
		private var v:Vector.<IGraphicsData>;
		private var result:Vector.<IGraphicsData>;
		private var copy:Sprite = new Sprite();
		private var inc:int;
		private var count:int;
		
		public function TestGrabby()
		{
			b.scaleX = b.scaleY = .7;
			copy.scaleX = copy.scaleY = .7;
			b.x = 240;
			b.y = 200;
			addChild( b );
			
			copy.x = 650;
			copy.y = 200;
			addChild ( copy );
			
			stage.addEventListener(MouseEvent.CLICK, onClick);
		}
		
		private function onClick(e:MouseEvent):void
		{	
			// reset
			inc = 0;
			stage.removeEventListener(Event.ENTER_FRAME, onFrame);	
			copy.graphics.clear();
			
			// sample
			v = b.graphics.readGraphicsData(true);
			count = v.length;
			result = new Vector.<IGraphicsData>(count, true);
			stage.addEventListener(Event.ENTER_FRAME, onFrame);	
		}
		
		private function onFrame (e:Event):void
		{
			if ( inc < count )
			{
				result[inc++] = v.shift();
				copy.graphics.drawGraphicsData(result);
			} else stage.removeEventListener(Event.ENTER_FRAME, onFrame);
		}
	}
}

I hope you guys will like it!

30 Rock – Tina Fey is sad about Flash Player 11.4

Don't worry Tina, Flash Player 11.4 is doing ok, we are taking good care of it ;)

Angry Birds Star Wars powered by Starling

Angry Birds - Star WarsA new version of Angry Birds has been launched recently by our friends at Rovio, please meet Angry Birds Star Wars!

Note that Angry Birds earlier this year (February 2012) was the first super popular game to use the Stage3D APIs through the use of the Starling framework.

We are super excited to see this new version also powered by Starling, have fun! See you on Tatooine.

Make your SWFs profilable with Scout

Scout logoI wanted to post a quick note about enabling your SWFs for Adobe Scout. There has been lots of discussions on Twitter and forums about that. Actually, this is something we have not really documented entirely and we will fix that very soon. Don't forget you can ask your questions on the Adobe Scout forum, we will be happy answering all your questions! Make sure you also check the Adobe Scout Vimeo channel, with video tutorials!

As you know, to get full profiling working with Scout, the SWF needs to be enabled for profiling. So to make it quick, today there are three ways to enable your SWFs with Scout.

The first way, is by using Flash Builder 4.7 and use the Telemetry option in the ActionScript compiler tab in your ActionScript project properties:

Telemetry UI

The second way to enable your SWF, which most of you probably don't know is to use the -advanced-telemetry compiler argument when using ASC 2.0. This is useful if you are using a tool like Flash Develop or any others for instance.

As a reminder, ASC 2.0 is the new compiler for ActionScript that is provided inside the AIR SDK bundled with Flash Builder 4.7 and the Gaming SDK. The UI above in Flash Builder actually just does that and appends this string to the arguments passed to the ASC compiler:

-advanced-telemetry=true

Finally, the third way to do it, is by using the post processing script. Which is useful in a scenario where you don't want to recompile the SWF, or cannot, because you don't have the sources anymore. Or if you are using Flex, because the -advanced-telemetry argument is only available in ASC 2.0 and not MXMLC. In this scenario, you just process the SWF and inject the specific tag required. We have a little Python script for that available here.

But this script requires Python and we have seen people having issues with this, so recently Renaun created this little app called Scout Enabler, which is all AS3 based, so no dependencies at all and has a nice GUI on top:

Scout Enabler

I hope this clarifies things. We will integrate that in the Getting Started document for Adobe Scout, so that it is clear to everyone and easy to find.

Starling Highlight – SpellCubes

Felix - SpellCubesI wanted to highlight a very nice and polished production using Starling called SpellCubes developed by RIActivate ApS. Spell Cubes is the well-known alphabet cubes found in many children’s room. Here is a little description of the app below from the SpellCubes website:

We believe that communication is key to human development, and that learning the alphabet is a crucial part of this development. Learning to read and write a language demands experience of the alphabet. You must learn each letters individual form, phonetic sound and how it in combination with other letters form a word.

That’s why we created Spell Cubes!

Spell Cubes brings the phonetic sound to the alphabet cubes, and shows how letters form a word. Spell Cubes lets you create and manage words, in different languages, for your child to play with, and spell over and over. Spell Cubes is the toddlers first playful meeting with the phonetic alphabet and the preschoolers place to experience a fun way to learn to spell new words.

The application looks gorgeous and is powered by Starling and Feathers, download it for your iPad!