Archive for September, 2009

Video of raw microphone access

Last night in Paris Mike debuted the new raw microphone access feature coming in AIR 2.0. This is a feature that has been asked for for years and I’m really happy to see it finally rolling out. The date on the video is off by a day but I don’t have time to re-encode it right now. Now you may be tempted to ask whether this feature will roll out in the next version of Flash Player as well. That is something that I can’t talk about right now.

Lee

Insider’s guide to Flash on the Beach 2009

Now that Flash on the Beach is over for another year, I thought I would write a quick recap since there were a lot of interesting things revealed at this year’s event. As I sit writing this I am in the Adobe France office recovering from the flu which hit me half way through the conference. Below are some of the highlights from FOTB in no particular order.

People love bytes
On Sunday, I gave a full-day workshop on using the ByteArray class in Flash. Half-way through I started to lose my voice and got a sore throat. Luckily I had Thibault there to help me throughout the day. The workshop was a little rocky in the beginning because I think there were some who didn’t need to do a recap on things like binary and hexadecimal numbers. But this was necessary just so everyone understood the basics. The class quickly got very excited when we started to build some real world examples like creating an FTP client and parsing and displaying a Photoshop PSD file. I think most people left the workshop with a ton of enthusiasm about low-level programming in Flash. Based on the great feedback, I will also be doing a similar workshop at FITC Amsterdam and FITC Toronto.

AIR 2.0 native extensibility
Although I didn’t get a chance to see Mike’s session, I was happy that we finally were able to announce some of the great new features in AIR 2.0. The biggest addition is the ability to call native processes directly from your AIR application. Mike showed an example where he created a screenshot application by communicating with a native process. As part of that application he also showcased another new feature in AIR 2.0 which is the ability to launch the default application for a particular filetype on the user’s system. Another demo Mike showed was the new volume monitoring feature where you receive events when a new device is plugged into the system. In this case it was an HD Flip camera. Go on over and check out the slides to get all the details.

gOptimizations
One of the sessions I was most looking forward to was Grant Skinner’s talk on optimizing ActionScript 3 code and it did not disappoint. Grant is one of the few speakers who can talk about really complex topics in a way that is understandable to us mortals. The talk was filled with great tips on making your code run faster and it was all backed up by actual numbers. I could run through some of the tips here, but it will be much better for you to just check out his presentation slides for yourself.

Ralph leaves Papervision3D
Unfortunately we were en route to Paris while Ralph Hauwert was giving his session but I have heard nothing but great things about from people who were there. One big piece of news is that Ralph has decided to leave the Papervision3D team to pursue other things. Now this should not be taken as a sign that Papervision3D is going away or that it is having trouble. The PV3D team is still going strong and we should still expect to see PapervisionX hit the streets at some point. As for what Ralph is going to do next, we’ll all just have to wait and see.

Flash CS5 gets a real editor
During the keynote, Richard showed a couple of sneaks from the next version of Flash. This was great especially since MAX is less than two weeks away. One of things that I was really happy to see was the addition of full custom class introspection in the Actions panel. This will make it much more enjoyable to write code in Flash for smaller projects and creating demos. I told you all that feedback you gave would make a difference :) . In addition to that, Richard also showed the new integration with Flash Builder as well. When you create a new class in Flash, it asks you whether or now you want to edit it in Flash or Flash Builder. If you choose Flash Builder, a project is created for you with the current FLA included. Also if you are in Flash Builder, you can create a new Flash Professional project directly and easily jump back and forth between Flash and Flash Builder.

Joa is on another level
Without question, the session that everyone was talking about was Joa Ebert’s session. He talked about some amazing tools he is writing to optimize SWF files. He basically called out Adobe for having a subpar compiler, and after watching his talk, I couldn’t help but agree with him. A lot of what he talked about kind of went over my head but it was amazing to see some of the optimizations he was able to make. All of us at the conference from Adobe left with the feeling that we need to work more closely with Joa in the future to try and get our compiler more up to date. One thing he said kind of hit home for me. ActionScript developers shouldn’t have to worry about doing all of these little code optimization hacks in order to get more performant applications.

Already looking forward to next year!
Lee

Flash on the Beach 2009 Trailer

John just handed me the new trailer for this year’s Flash on the Beach conference. This conference just keeps getting better and the new trailer is equally impressive. This year’s trailer was made by Artillery.

Lee

Using BitmapData.setVector for better performance

During the ByteArray workshop yesterday we wrote some code that parsed a PSD file and displayed it in the Flash Player. As part of this I showed setting the pixels of the BitmapData object using the setPixels method. I had heard that this method was slow but Thibault confirmed this for me. He suggested that I try a new method that was introduced in Flash Player 10 called setVector. This allows you to take a Vector object containing 32-bit floating point numbers and use it to set the pixels in the bitmap. Below is the original code using setPixel which required a nested for loop.

1
2
3
4
5
6
7
8
var bmd:BitmapData = new BitmapData(width, height);
for(var y:int=0; y<height; ++y)
{
    for(var x:int=0; x<width; ++x)
    {
        bmd.setPixel(x, y, r.readUnsignedByte()<<16 | g.readUnsignedByte()<<8 | b.readUnsignedByte());
    }          
}

The new code which takes advantage of setVector is shown below. There is one trick to getting this to work. You have to shift a value of 255 (aka 0xFF) to the far left byte as you need to provide an ARGB number for it to work. Otherwise your pixel would have an alpha of zero.

1
2
3
4
5
6
7
8
9
10
var numPixels:int = width*height;
var pixels:Vector.<uint> = new Vector.<uint>(numPixels, true);
           
for(i=0; i<numPixels; ++i)
{
    pixels[i] = 0xFF<<24 | r.readUnsignedByte()<<16 | g.readUnsignedByte()<<8 | b.readUnsignedByte();
}          
           
var bmd:BitmapData = new BitmapData(width, height);
bmd.setVector(new Rectangle(0, 0, width, height), pixels);

The BitmapData class is smart enough to put all the values into the right places in the bitmap so you don’t have to deal with nested loops.

Lee

ByteArray examples, links, and slides

Thanks to everyone who attended my ByteArray workshop yesterday at Flash on the Beach. So far I have only gotten good feedback. I started losing my voice half way through the day but thankfully I had Thibault with me to help me through the rough bits. We learned for instance that it is apparently easier to write the number 100 as 0×64.

I was really happy that almost everyone in the workshop was able to connect to an FTP server and get a PSD file to display. Almost everyone also got a nice taste of the dreaded End of file error that happens often when doing ByteArray work.

You can now download the slides and the finished class files from the workshop. You can also use the ByteTrainer application if you need to brush up on binary numbers.

Lee

The Adobe Influxis Latin Flash Tour

I am very happy that I can officially announce the Adobe Influxis Latin Flash Tour! As I have talked about in previous posts, I was looking for a company to sponsor the tour and the great guys over at Influxis didn’t hesitate to jump on board. They immediately expressed an interest in helping to spread some Flash love to many places in Latin America that are not ordinarily on the itinerary. I can’t express enough how much I appreciate them doing this as the tour would not be happening without them. More about Influxis in some future posts, but now let’s talk about the tour.

Below is a first draft of the tour graphic but you can go ahead and embed it into your blogs if you want to start generating buzz about the tour. Now to all my new Brazilian friends out there you will notice the lack of your flag on the graphic. Unfortunately this tour won’t be hitting your country this time. There are a few reasons for this. Firstly, I just got back from a 4 city tour there and visited with dozens of companies as well. A visit to Brazil would mean I would have to cut out a country like Chile or Peru. Also there may be people joining the tour and the visa process is not something that can be done at the last minute. But from what I hear there will be a Flash Camp in Brazil very soon.

The actual schedule is close to being finalized. Make sure you check back here often to see if there have been any changes. For now the schedule is the following:

Nov 7th – Santiago, Chile
Nov 9th – Buenos Aires, Argentina
Nov 11th – Lima, Peru
Nov 13th – Bogotá, Colombia
Nov 16th – San Jose, Costa Rica
Nov 18th – Mexico City, Mexico
I will make more posts soon about the actual content and speakers. But basically the idea is to show all the cool new stuff coming out at MAX for those who can’t afford the trip to Los Angeles. Please join me in thanking Influxis for again supporting the Flash community in a big way!
Lee

Questions for “Just Ask Us” episode 2

Yes it’s that time again. You can now get your questions in for the second episode of Just Ask Us. I will accept questions until Friday at 9:00 PM California time. Due to popular demand, I will create links to each individual question in the video once it goes live. Remember you can ask anything you want but technical questions that would require code snippets do not really lend themselves to this medium.

Thanks!
Lee

Next Page »