I woke up this morning...

and found the public beta of flash player 10 was out. How cool is that.

I knew this would be coming before too long, but didnt realize that it would be out so quickly. This new version is filled with lots of new features aimed at allowing greater "expressiveness" in flash player content, such as 3d effects, custom filters, enhanced text rendering, and revs to the drawing API. Of course, like each version before it, FP10 also has lots of performance enhancements. What are you waiting for go get it on adobe labs

I'm particularly looking forward to working with the Advanced Text Rendering features, which promise to allow lots of layout possibilities, including bi-directional text!

more later

My Speaking Engagements for the first half of 2008

1/18 - Flex Camp Chicago

1/24 - Flex Camp Omaha

2/24-2/27 - Flex 360 Atlanta

3/12-3/13 - CFUnited Europe

5/1-5/4 - CF.Objective()

5/19-5/23 - WebManiacs

6/25-6/28 - CFUnited

Hey, what am I doing on blogs.digitalprimates.net?

I've been a bit slow in getting this announcement out, as I see several other bloggers have already posted on this, but the rumors are true.  Tapper, Nimer and Associates. Inc. has teamed up with Digital Primates Inc.    Some of you may recall, it was just over a year ago that I teamed up with Mike Nimer to form Tapper, Nimer and Associates.  It's quite an odd experience for me to go from a solo propietorship to a team of 15 or so developers in about 16 months.   With all the great minds from both our companies working together, we will be able to help more customer on bigger and better projects.  

Many of you probably know Mike Labriola for his work on custom Flex Components, he has extended the Flex framework in ways that the developers at Adobe never even imagined.  He is also frequently speaking at conferences and User groups.  Both Nimer and I ran across him at dozens of speaking events across the country, and as we talked, we found there were far more similarities between us then differences. 

One of our first meetings at a conference ended up with him as a co-author on the Flex 2 book.  A year and a half of meeting at conferences later, and we were helping each other out on projects so frequently that it made sense to explore further integrating our companies.  When the opportunity for Nimer and I to join forces with him and his company, it was much too enticing to pass up.

We are looking forward to doing great work together, continuing to build cutting-edge applications for our clients, continuing to teach the world to build better RIAs, and continuing to serve the community. 

Reflecting an image in Flex

Increasingly, clients have been asking for a "reflection" effect, showing a vertically flipped image of a component next to the actual component.  After reinventing the wheel on this several times, I came up with this simple reusable component:

package com.tappernimer.components{
import mx.containers.Canvas;
import mx.core.UIComponent;
import flash.display.BitmapData;
import flash.geom.Matrix;
import flash.display.IBitmapDrawable;
public class VerticalReflection extends Canvas{
private var _component:UIComponent;
public var trans:Number=.5;
public var filterArray:Array=new Array();
public var skewY:Number=0;
public var skewX:Number=0;
public function get component():UIComponent{
return _component;
}
public function set component(c:UIComponent):void{
this._component = c;
// hack to work around issue with component being 
// a dynamically loaded image its possible for the 
// image to be fully loaded, but its height or width 
// not yet set this call later, keeps retrying until 
// the values are set.
if(c.width ==0 || c.height==0){
callLater(resetComponent,[c]);
return;
}
doReflection();
}
private function resetComponent(c:UIComponent):void{
this.component = c;
}
private function doReflection():void {
// create bitmap object
var bmpData:BitmapData = new BitmapData(
	component.width,component.height);
// create matrix
var invertMatrix:Matrix = new Matrix(1,skewY,skewX);
// set matrix to invert vertically, but normal horizontally
invertMatrix.scale(1, -1);
// move matrix, so top is at bottom, and vice versa
invertMatrix.translate(0, component.height);
// draw component flipped
bmpData.draw(component as IBitmapDrawable,invertMatrix);
// create a new holder for the image
var ref:UIComponent = new UIComponent();
// match new holders size to the original
ref.setActualSize(component.width,component.height);
// fill the new component with the image
ref.graphics.beginBitmapFill(bmpData);
ref.graphics.drawRect(0, 0, 
	component.width, component.height);
ref.graphics.endFill();
// set the transparency
ref.alpha = trans;
// apply any filters
ref.filters = filterArray;
// add image to stage
addChild(ref);
} 
}
}

This component can then be passed any other component to reflect, accepting filters (filterArray), alpha value (trans), and arguments to allow you to skew the reflection.  In fact, using it can be as simple as this:

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx=http://www.adobe.com/2006/mxml 
xmlns:c="com.tappernimer.components.*" 
layout="absolute">
<mx:Image id="image" source="images/tn_logo_full.jpg"/>
<c:VerticalReflection id="ref" 
component="{image}" 
x="{image.x}" y="{image.height}" 
filterArray="{new Array(new BlurFilter())}"/>
</mx:Application>
Here is the code running:
 
 

H.264 Support in FlashPlayer

I missed it yesterday, when it was announced, but Adobe has now announced support for H.264 (also know as MPEG4) in an upcoming version of the flash player.  H.264 is the same standard which is used by BluRay and HD-DVD -- the ability to have this type of video in our web applications is absolutly huge.  Remember, not that long ago, Adobe announced plans for the Adobe Media Player (AMP), as a desktop application which was built with AIR and Flash -- now, AMP will be able to use H.264 as well as FLV for its video content.

 

 

FlexManiacs 2007 - Getting Started with Apollo

As promised, here are the starting files from my "FlexManiacs 2007 - Getting Started with Apollo" session.  Thanks for attending my session, I hope you enjoyed it and the FlexManiacs Conference.

Overall, i thought this conference was a great success.  Many attendees of all levels.  Great networking, Great debates, and an all around good time.

A Great big pile of public beta's from Adobe

Today, Adobe has released 3 new public beta's on Adobe Labs:   The Adobe Integrated Runtime (formerly known as Apollo) beta, the Flex 3 Beta, and the Flash Player Updater were all publicly released on Labs today.  I've been recovering from a failed hard drive all day (remind me to post a blog about the wonders of SpinRite 6.0 when i get a minute), but I'll post more about all 3 of these, as well as the ColdFusion 8 (Scorpio) beta released 2 weeks ago, when i get a few minutes.

Flash Player 9.0.28 bug - embeded images and ContextMenu

In work for a particular client, we noticed an odd little bug with the latest Flash Player (9.0.28).  It seems that context menus (the items which appear when you right click) dont work when the right click is on an embeded image.  Take a look at this simple example:

main.mxml:

 <?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
 xmlns:v="*"
 layout="vertical">
 <v:DisplayIcon label="Embeded" useEmbeded="true" />
 <v:DisplayIcon label="Loaded" useEmbeded="false"/>
</mx:Application>

DisplayIcon.mxml:

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
 creationComplete="buildContextMenu()" height="110" width="216">
 <mx:Image id="img" horizontalCenter="0"/>
 <mx:Label text="{label}"  horizontalCenter="0" bottom="0"/>
 <mx:Script>
  <![CDATA[
   import flash.ui.ContextMenu;
   import flash.ui.ContextMenuItem;
   [Embed(source="TapperNimer_logo.png")]
   public const yellowBevelPerson:Class;
   [Bindable]
   public var textStr:String;
   public var useEmbeded:Boolean
   public function doEmbed():void{
    if(useEmbeded){
     img.source = yellowBevelPerson;
    } else {
     img.source = "TapperNimer_logo.png";
    }
   }
   protected function buildContextMenu():void{
    var myContextMenu:ContextMenu = new ContextMenu();
    myContextMenu.hideBuiltInItems();
    var items:Array = new Array();
    var item:ContextMenuItem = new ContextMenuItem("Display Text");
    items.push(item);
    myContextMenu.customItems = items;
    this.contextMenu = myContextMenu;
    doEmbed();
    
   }
  ]]>
 </mx:Script>
</mx:Canvas>

As you can see, the DisplayIcon component has an image and a label, and based  on the value of the useEmbeded property, it will either embed the image, or load it dynamically at run time.  As you can see from these 2 screen shots, the problem arises when i right click on the top (embeded) image.  it shows the default context menu, rather than the custom one i have specified.

 
 

Fortunately, the work around is easy enough, if you set the mouseEnabled property of the image tag to false, it solves the problem

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
  creationComplete="buildContextMenu()" height="110" width="216">
 <mx:Image id="img" horizontalCenter="0" mouseEnabled="false" />
 <mx:Label text="{label}"  horizontalCenter="0" bottom="0"/>
 <mx:Script>
  <![CDATA[
   import flash.ui.ContextMenu;
   import flash.ui.ContextMenuItem;
   [Embed(source="TapperNimer_logo.png")]
   public const yellowBevelPerson:Class;
   [Bindable]
   public var textStr:String;
   public var useEmbeded:Boolean
   public function doEmbed():void{
    if(useEmbeded){
     img.source = yellowBevelPerson;
    } else {
     img.source = "TapperNimer_logo.png";
    }
   }
   protected function buildContextMenu():void{
    var myContextMenu:ContextMenu = new ContextMenu();
    myContextMenu.hideBuiltInItems();
    var items:Array = new Array();
    var item:ContextMenuItem = new ContextMenuItem("Display Text");
    items.push(item);
    myContextMenu.customItems = items;
    this.contextMenu = myContextMenu;
    doEmbed();
    
   }
  ]]>
 </mx:Script>
</mx:Canvas>
 
 

This bug has been filed and acknowleded by Adobe, so will hopefully be solved in the next release of the flash player...

 

 

Flash Player 8.5 has been renamed flash player 9

In a wise marketing move, Adobe has renamed the flash player 8.5 public beta as the flash player 9 beta.
According to the Flash Player FAQ on Adobe labs, they will be publicly releasing the first beta of FP9 with Beta 3 of Flex 2.  They also acknowledge that the next version of the Flash Authoring tool (code named Blaze) will target the same Flash Player 9.

Considering the new Flash Player has a entirely reworked runtime (or virtual machine, if you prefer), it would seem that the next player is taking as large a step as any release since Flash Player 5, so the full version number, as opposed to a .5 version makes complete sense.

Any of you detecting for FP8 in your applications should ensure your code is looking for a major version >= 8, not simply == 8.

BlogCFC was created by Raymond Camden. This blog is running version 5.9.001.