Archive for October, 2007

AFComponents Using the Pixelfumes Reflect Framework

Wednesday, October 31st, 2007


Andrei over at Advanced Flash Components shot me an email to this post on their blog. They took the framework from the Reflect class I wrote and created a nice method of creating reflections within their framework. Check out the post and play with the video demo. Thanks for sharing Andrei!

AIR Version of the Stacks Class

Tuesday, October 23rd, 2007

Following along the lines of my earlier post, AS3 OSX Leopard-like “Stacks” Class with Source, I decided to see what I could do with the Stacks class and AIR. You can see a really rough demo in the video below – press the fullscreen button to see what is really going on. I wish AIR 1 supported launching files in the default application! I will not be releasing the AIR version but thought it might be neat to show you how the icon data is being pulled in (thanks Kevin Hoyte):

//within a Drag and Drop operation
var fa:Object = e.clipboard.getData(ClipboardFormats.FILE_LIST_FORMAT);
var iconBMP:Bitmap = new Bitmap(fa[0].icon.bitmaps[0]);
iconBMP.smoothing = true;
var m:MovieClip = new MovieClip();
m.addChild(iconBMP);

AS3 OSX Leopard-like "Stacks" Class with Source

Tuesday, October 23rd, 2007

Its no secret that I have become quite the Apple fan. Given that, I have been eagerly awaiting the release of OS X Leopard. Leopard has a neat new feature called “Stacks” related to the dock. If you want to learn more about the new dock and stacks you can do so here.I thought it would be neat to pay homage to Apple and give a go at creating “Stacks” in AS3. In the demo below you can view my attempt. It took me awhile to dig through sites for a good actionscript-based equation that would give me a curve that I liked.As3 is awesome – you can really pass any type of Display Object into the stack using the stackInstance.addItem() method. It expects a MovieClip – the demo below just uses one that I made in the library. The stack items can really look and be whatever you like.This is open source so feel free to improve and mod the class. Please share any improvements you have. As always, any link-backs or references are appreciated when using my classes.

If you want to play with the class you can download the class and FLA for the example above.

AS3 Problem Targeting MovieClips Containing Nested Clips

Tuesday, October 9th, 2007

**UPDATE:
Thanks to Robert Penner, Xtian, Jeremy, Val and Wayne for the testing. Jeremy got the answer: var smallMc:MovieClip = large_mc.getChildByName(“small_mc”) as MovieClip
trace(“works ” + smallMc); I know I have done that in the past but for some reason today it was killing me! View the comments thread for some good detail.

[Original Post Follows]

Today I ran upon the strangest thing I have seen in awhile – actually, I am surprised that I have not run upon it before. I had my friend Xtian try to replicate this as well and he was able. Therefore, I thought I would run it bast the awesome members of the Flash blogosphere.

The Scenario
Flash CS3, Exporting as Flash 9, AS3
I have a MovieClip on the stage with an instance name of large_mc. large_mc contains a clip with an instance name of small_mc. small_mc contains a clip with an instance name of verySmall_mc.

The Problem
I want to target small_mc and have it return as a MovieClip. Now, we all know that in AS3 in general, objects return to us as DisplayObjects. In this scenario I assumed that I could do the following:
MovieClip(large_mc.small_mc);
//or
large_mc.small_mc as MovieClip;

These methods return the following:
[object small_mc_2]

Now, granted AS3 is newer and I haven’t seen it all – but where the heck is that basic object coming from and why is it adding _2 to my instance name? So I thought I would exhaust all of my methods and try the following trace actions:
//traces object
trace(large_mc);
//traces object
trace(large_mc.small_mc);
//traces MovieClip (last level of nesting)
trace(large_mc.small_mc.verySmall_mc);

trace(“—————”);

//traces object
trace(MovieClip(large_mc));
//traces object
trace(MovieClip(large_mc.small_mc));
//traces MovieClip (last level of nesting)
trace(MovieClip(large_mc.small_mc.verySmall_mc));

trace(“—————”);

//traces object
trace(large_mc as MovieClip);
//traces object
trace(large_mc.small_mc as MovieClip);
//traces MovieClip (last level of nesting)
trace(large_mc.small_mc.verySmall_mc as MovieClip);

Apparently if you crawl all the way through the nest to the final nested clip, verySmall_mc, you finally get a MovieClip.

The Question
Besides, “What the heck is going on here” I want to know how you would target the small_mc clip nested within large_mc. Basically the AS3 equivalent to the AS2 version of the code: large_mc.small_mc.

Another Kicker and Strange Point
Go into your library and assign the MovieClips to export for ActionScript. Watch the erros fly as the compiler has no idea what small_mc_2 is.

Xtian found that this code will return a reference to small_mc:
trace(large_mc.getChildAt(1));

Now THAT is messed up – childAt(0) returns Shape and childAt(1) returns MC – is this pulling the children from the layer/level stack it is on the physical timeline? Now this is all fine and good but what if there are multiple nested clips within large_mc – how do I know which is Child(0).

Any help appreciated – thanks to Xtian for finding the export issue as well.

Download the Example
You can download my example FLA here.

AMP (Adobe Media Player) Beta Available on Labs

Monday, October 1st, 2007

Many of you may have heard about it… You may have even seen it at the onAIR Bus Tour… Now Adobe has the AMP (Adobe Media Player) available on Adobe Labs for you all to play with. Jump over to the media player page on labs to get the install.

Adobe says:

The Adobe® Media Player™ enables end users to enjoy their shows whenever and wherever they want, while enabling new ways for content businesses to create, deliver, and monetize high-quality content and advertising through a customizable cross-platform player that supports both downloaded and streamed media.

Adobe is driving the next generation of internet video delivery with the Adobe Media Player (AMP), the Flash® Media Server, content protection technologies, and a broad and powerful ecosystem of partners providing key solutions from content creation through delivery and monetization. AMP brings the best of both the broadcast television and web video worlds to your desktop—providing high-quality content both online and offline, with a wide range of business model possibilities

I think this is an interesting move for Adobe. I have had the opportunity to play around with AMP a bit and find it a different experience than I have had with other media players. Things could really be looking up with the recent news of Flash Player 9 Update 3 (Moviestar) supporting H264 and other Quicktime formats.