By scott
I recently received my iPod Nano from 360Flex, it is even engraved with my name and the conference name and location. All I did was fill out a simple survey. You see, filling out those surveys really does pay off! See you in Seattle.

By scott
Well that didn’t take long, Adobe posted the latest Flash Player penetration rates and 84% of users in the US and Canada are now equipped with Flash Player 9. In the past it usually took 2 years to reach 80% penetration, it only took 10 months for Flash Player 9. Amazing.This is the first time we will actually be able to publish something with the latest version of the Flash IDE and be confident that most people will be able to see our “stuff”.
Great work Adobe, and take that Microsoft.
By scott
Adobe has announced that they are planning, over the next year, to open source the Flex SDK. Using the Mozilla Public License developers will now be able to contribute and enhance the Flex SDK including the Flex framework classes, the Flex components, the Actionscript debugger, the Actionscript 3 compilers (including the mxmls and compc compilers).
Starting in June 2007 Adobe will be posting daily builds of the Flex SDK and providing open access to a bug database online. In December of 2007 after the release of “Moxie” (Flex 3) Adobe will be posting all software assets into a public Subversion repository for public access.
What this means is development models and methods can now be drastically improved or invented. If you want to develop a Flex app using Rails, go for it. If you want to use .NET to build your Flex app, be Adobe’s guest. What this doesn’t mean is open source of the Flash Player, nor should it be (IMO) open sourced. While you are still limited to the capabilities of the Flash Player, your development process is now not limited to the existing SDK. In fact, any software developer can now make their own IDE, Flex Builder and Flash CS3 need not apply.
Flex has seen extraordinary growth in the past 6 months. Enterprise applications are popping up all the time. And with the launch of Silverlight (worst name ever by the way) the RIA arena just got a little more crowded. Personally, I feel that opening up the SDK will help attract a whole other breed of developers, ones that feel tied down to a corporate development environment. For the same reasons developers were staying away from .Net in its early day, they are staying away from Flex. Corporate controlled development environments and languages are always limited to the limits of the compiler, languages, and/or authoring environments. Back in the day, the open source arena exploded with the likes of PHP, Apache, Tomcat, etc. all open sourced and equally as powerful (or more so in my eyes). Suddenly .Net or Java was limited to developers or companies with very deep pockets. Open sourcing has worked for PHP and it is the reason it wasn’t gobbled up by corporate backed languages such as .Net or Java, <sarcascm>take a look around, you may notice a few PHP sites on the good old interweb.</sarcascm>.
Will Flex be the next PHP? Will the community take Flex development to the next level? Will Flex development now be the defacto when it comes to RIA, is it already? No one knows, only time will tell. A colleague of mine just had an interesting quote. “There are no open source millionaires.” I don’t think Adobe cares about that, that’s Microsofts attitude. Adobe just wants to provide the best possible solutions for their customers. They’ll keep making money from products like Photoshop
By scott
I have had many people request that I post the code to my ExternalInterfaceBuffer class that I made reference to in my ExternalInterface…HELP posting. This code is part of the Yahoo Maps AS3 Communication Kit that I wrote and can be downloaded from the Yahoo! Flash Developer Network. As a bonus you will also get some other very cool Yahoo! AS3 API wrappers, Search, Answers, Weather, and Upcoming.org. To make a long story short, the issue I noticed was some of my ExternalInterface calls were getting dropped. I did a boat load of debugging, and discovered it was actually the browser script engines overloading and dropping the calls. So I wrote a singleton class that queues up all the ExternalInterface calls and sends them one at a time in 50 second intervals. One thing I noticed, 50 second intervals works fine with Actionscript 3, Actionscript 2 is a lot slower so I had to slow it down to 100 miliseconds or else I was running into the same issues, just not as often.
/*
Copyright (c) 2007, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.2.0
*/
package com.yahoo.webapis.maps.utils {
import flash.external.ExternalInterface;
import flash.utils.setInterval;
import flash.utils.clearInterval;
/**
* Utility to buffer outgoing ExternalInterface calls. Simoltaneous
* calls get dropped if they aren't buffered. It seems both Firefox and
* IE's script engine gets overloaded and either drops calls or
* throws a javascript error. This buffer ensures the script engines
* only get one call at a time.
*
* @langversion ActionScript 3.0
* @playerversion Flash 9
* @author Scott Morgan 02/25/2007
*
* @see flash.external.ExternalInterface
*/
public class ExternalInterfaceBuffer {
/**
* @private
* A singleton class that is accessed by almost all classes in this
* communication kit. This static variable gives access to this class
* ensuring there is only ever one instance of it.
*
*/
private static var instance:ExternalInterfaceBuffer = new ExternalInterfaceBuffer();
/**
* @private
* An array of methods waiting in the queue to be called. Once they
* are called they are removed from the array.
*
*/
private var methodQueue:Array = new Array();
/**
* @private
* Access to the interval that runs while the methods are being called.
* When all methods in the queue are called this variable is used to
* clear the interval.
*
*/
private var methodCallInterval:Number;
/**
* Constructor
* If an instance of this class already exists an error message is thrown
* informing that this class should only be accessed through the getInstance()
* method.
*
* @see com.yahoo.webapis.maps.utils.ExternalInterface.getInstance()
*/
public function ExternalInterfaceBuffer() {
if( instance ) throw new Error( "Singleton and can only be accessed through Singleton.getInstance()" );
}
/**
* @public
* This static method is what makes this class a singleton, it ensures that only
* one instance of this class is instantiated.
*
*/
public static function getInstance():ExternalInterfaceBuffer {
return instance;
}
/**
* @public
* Method used to add calls to the methodQueue array. If the length of the methodQueue
* array is greater than 0 the methodChurn interval is kicked off and runs every 50
* milliseconds until the methodQueue's length is 0 at which point the interval is
* cleared.
*
* @param obj and object containing a method string, and a data
* object. The method string is the method the ExternalInterface will
* call and the data object is the object that will be passed to the
* calling method as an argument.
*/
public function addCall(obj:Object):void {
methodQueue.push(obj);
if (isNaN(methodCallInterval) || methodCallInterval == 0) {
methodCallInterval = setInterval(methodChurn, 50);
}
}
/**
* @private
* This method is called every 50 milliseconds until the methodQueue array is empty.
* This method sends the first method listed in the methodQueue array to the
* ExternalInterface.call method.
*
* @see flash.external.ExternalInterface.call
*/
private function methodChurn():void {
if (methodQueue[0].method != undefined && methodQueue[0].method != null) {
ExternalInterface.call(methodQueue[0].method, methodQueue[0].data);
}
methodQueue.shift();
if (methodQueue.length == 0) {
clearInterval(methodCallInterval);
methodCallInterval = undefined;
}
}
}
}
Pretty straightforward stuff. Ok, that’s great, now how do you use it. Simple, one line of code, well two because you have to instantiate the class.
First you have to remember to import the class
import com.yahoo.webapis.maps.utils.ExternalInterfaceBuffer
Then you have to instantiate, you may choose to write one line of code to instantiate the class and call the addCall method in one line. I was used this class multiple times in the class so I instantiated it once and made reference to it with a variable scoped to the class.
private var EIBuffer:ExternalInterfaceBuffer = ExternalInterfaceBuffer.getInstance();
And lastly, add your call to the queue by calling the public addCall method. This method expects an object containing a String containing the method name and an encapsulated data object that contains the arguments you want to pass along to the method being called via the ExternalInterface.
EIBuffer.addCall({method:"myJavascriptMethod", data:{argA:'blah', argB:'merp', argC:'DOH'}});
That’s it, I know I could of made it a bit more elegant but it does everything I needed at the time. Plus it’s open source, now the world can all join in and make it perfect
Enjoy!