Flex, AIR Projects without Flex, Part 1
Flex, AIR Projects without Flex, Part 1, Posted in General, August 15th, 2010

MXML is a great markup language. It is getting more extensible all the time and, often, is something you want to use in non-flex projects. In order to provide complete understanding on how to build MXML web and desktop applications ( Adobe AIR ) without the Flex framework; I am embarking on this multi-part journey to divulge the inner workings of Flex and AIR.

Flash Builder ( i.e. Flex Builder ) provides a very convenient wrapper and configuration for building Flex and AIR applications. It does not allow, by code-hinting, extending a non IUIComponent or UIComponent object in MXML e.g. <l:Sprite /> . So we do this with a little trickery.

After creating your default application ( be it either Flex or AIR ) you will need to create a ActionScript main file. Unlike other languages, the main in ActionScript becomes implemented at the flash.display.Stage and all of your other assets build from there. I tend to call this class Main.as, it can be placed anywhere in the source folder. Next you will have to manually change the “Default Application” MXML file to extend your Main.as. This is simply done by adding the namespace xmlns:local=”*” ( whereas * is the same package the Main exists in ). Then change <s:WindowedApplication /> or <s:Application/> to <local:Main />. The application should compile without errors.

Note, however, nothing displays on the screen. I usually add a trace statement in the Main constructor that allows me to verify that everything just started ok.

The ability to inject code at the stage level easily allows for not only bootstrapping of Pure ActionScript projects but also the ability to do a variety of tasks before starting Flex at all. Some instances, this may be a dependency checker/updater of some kind. In AIR, this could be a splash screen or some other useful action.

Here is a Zip file containing an example AIR application.
NoFlexAir.zip

Thats it for the first post, hope it was helpful. My email is at the top of this page if you have any questions.

P.S.
Using the non-system-chrome takes a lot of resources and essentially allows draw space over your entire screen estate. I have a inkling that the Popup / Context Components draw in some super-layer however I will cover that in another post.

Progressive Flash Video Publish
Progressive Flash Video Publish, Posted in General, August 2nd, 2010

I was working on something this week and was unable to find any help on google on how to publish ultra quality video with the flash player. The idea was to just buffer the entire video’s contents and slowly upload it. Its actually more simple than it looks however the ActionScript 3 docs don’t cover this at all.

Configuration
Here is the low down, the Camera.quality setting always drops frames — even when you also have the bandwidth setting enabled. Setting Camera.quality to 0 then the bandwidth setting to something large such as 500,000 kb/s will provide an excellent video. In the mean time, also maximize your camera frame-size and frame-rate.

The Buffer
Watching the bufferLength property to see the size of your buffer. Removing the devices from the NetStream when you want to finish recording but remember that you have to wait for bufferLength to 0 out before closing the connection or your upload will be lost forever.

CommitOnly is broken on BindingUtils, vote now!
CommitOnly is broken on BindingUtils, vote now!, Posted in General, July 26th, 2010

BindingUtils.bindSetter CommitOnly is broken and it got marked community so vote on this issue now!

https://bugs.adobe.com/jira/browse/SDK-26901

I know you don’t need to hear from me regarding semantics but..
I know you don’t need to hear from me regarding semantics but.., Posted in General, July 13th, 2010

The use of ‘on’ and ‘handle’ seems to daunt me. Some people do it the way I think is correct but most don’t; so here it is.

‘ON’ is used when self or this is the dispatcher of said event you are listening to. If you extend spark Group and listen to Creation Complete then it should be onCreationComplete

but..

“HANDLE’ if the dispatcher is external. If Class A is listening to Class B’s CreationComplete then you should name the internal handler handle{ObjectName}_CreationComplete.

Hope that helps. This will keep your code much easier to read in the future to determine the external and internal dependencies.

That is all!

Safari 4 Tabs
Safari 4 Tabs, Posted in General, June 16th, 2009

With Safari 4 final, we lost our beloved top-tabs. However, hope is not lost. All you have to do is replace Safari.app with the beta version (15MB) and you’ve got your tabs back. Sadly, I cannot host the file so you need to get it some other way.

Yumm, Vegan Brownies
Yumm, Vegan Brownies, Posted in Food, June 1st, 2009

This is an extension of this recipe.

Ingredients:

  • 2 cups unbleached all-purpose flour
  • 1 1/4 cup unbleached evaporated cane sugar
  • 3/4 cup brown sugar
  • 3/4 cup unsweetened cocoa powder
  • 1 teaspoon baking powder
  • 1 teaspoon salt
  • 1/2 cup water
  • 1/2 – 3/4 cup Coconut Milk
  • 1 cup vegetable oil
  • 1 teaspoon vanilla extract
  • 3-4 tablespoon extra creamy peanut butter
  • 1 teaspoon Omega 3 & 6 oil

350 degrees, 9×13 pan is about 30 minutes. 8×8 pan is 55 minutes. And yes, when you mix this it will clump into one massive mix blob instead of a smooth batter you get with off the shelf mixes. Bake until it passes the penetration test. ( no gunk sticks to whatever your poking the brownies with )

Note: I added a few pieces of baking bittersweet chocolate, being made with Milk Fat turns this recipe into “Vegetarian” so I left it out here.

Cross Platform CD-ROM Flash Dev
Cross Platform CD-ROM Flash Dev, Posted in Flash, General, June 4th, 2007

I found this link from a HOW-TO I made a long time ago that used to be linked from the old blog.

Cross-Platform CD-ROM Development PDF