Archive for June, 2006

ActionScript 3 : Get a Class Reference by Class Name

If you need to get a reference to a class in ActionScript 3, but only know the class name, then you can use the flash.utils.getDefinitionByName to create an instance of the class.

For example:

import flash.display.Sprite;
import flash.utils.getDefinitionByName;

public class DynamicCall extends Sprite
public function DynamicCall()
var ClassReference:Class = getDefinitionByName(“String”) as Class;
var s:String = (new ClassReference(“foo=”) as String);

This basically creates an instance of the String class, from the class name “String”. getDefinitionByName takes the entire class path, so if you wanted to create an instance of MovieClip, you would provide the entire path:

[code] var ClassReference:Class = getDefinitionByName(“flash.display.MovieClip”) as Class;[/code]

Anyways, pretty simple stuff, but can come in useful.

Grant Skinner on understanding the Garbage Collector in the Flash Player

Grant Skinner has posted the first in a series of articles on understanding the garbage collector in the Flash Player’s virtual machine. From the first article:

Over the next few weeks (or even months), I will be writing a series of articles on this topic. I will look at the underlying mechanics of the Garbage Collector, discuss the problems you are likely to face, examine the new tools available to you for handling resource management in AS3, and offer solutions/code to help you circumvent many of the common problems you will face.

You can view the entire article here.

Apollo Screenshots

Ryan Stewart has posted some screen shots of early Apollo applications that he took during today’s Adobe Developer’s Week session on Rich Internet Applications.

You can view the screenshots here.

On Microsoft, PDF and the threat to open standards

Last week the Wall Street Journal reported that Adobe had been in talks with Microsoft and had expressed concerns about Microsoft’s inclusion of PDF (and other document export features) in the next version of Office. This triggered quite a bit of discussion online, and I wanted to make a quick post and hopefully help to clear up some of the resulting confusion as well as help correct some misperceptions.

Continue reading…