Archive for February, 2008

“So what’s it like being on the Flex SDK team?”

Get an inside look at our team in some fun videos that Matt Chotin, our product manager, showed at 360 | Flex.

Grab the source code to the Flex SDK

Step 1: Get yourself a Subversion client. My favorite is TortoiseSVN, although that’s Windows-only. There’s a free version of SmartSVN that’s cross-platform, and I use that on the Mac. Or you can go barebones with the command-line client, svn, from the Subversion site.

Step 2: Point your client at http://opensource.adobe.com/svn/opensource/flex/sdk and do a checkout. If you use this URL, you’ll actually get three branches:

* trunk – where we’ll develop Flex 4
* branches/3.0.x – where we finished up Flex 3 and will develop Flex 3.0.1
* tags/3.0.0.477 – the code that built the release we just shipped

If you want only one of these, you can check out just the piece you want.

For more info, see the instructions here on our open-source project site.

Disassembling a SWF with swfdump

I mentioned in an earlier post that the open-source Flex SDK project includes a Java library — swfutils.jar — that supports reading and writing SWF files and the ActionScript Byte Code (ABC) inside them.

The bin folder of the SDK includes a command-line tool, swfdump, which uses swfutils.jar to produce a disassembly of a SWF file. It doesn’t bear much resemblance to your MXML and AS source code, because that got compiled down to low-level instructions for the ActionScript Virtual Machine. But it provides the most detailed info about a SWF that you can obtain.

Take any old SWF and do this:

swfdump -abc MyApp.swf > out.txt

I suggest piping the output to a file, or you’ll end up waiting a long time for the output to scroll by in your shell window.

Here an example of what the getter and setter for the label property of mx.controls.Button look like:

Getter:

B2 13 01 01 0B 0C 06 function get mx.controls:Button:::label()::String
maxStack:1 localCount:1 initScopeDepth:11 maxScopeDepth:12
D0                       getlocal0
30                       pushscope
60 AA 10                 getlex        	private:_label
48                       returnvalue
0 Extras
0 Traits Entries

Setter:

B3 13 03 02 0B 0C 3D function set mx.controls:Button:::label(:String)::void
maxStack:3 localCount:2 initScopeDepth:11 maxScopeDepth:12
D0                       getlocal0
30                       pushscope
5E A1 10                 findproperty  	private:labelSet
26                       pushtrue
68 A1 10                 initproperty  	private:labelSet
60 AA 10                 getlex        	private:_label
D1                       getlocal1
13 2B 00 00              ifeq          	L0
5E AA 10                 findproperty  	private:_label
D1                       getlocal1
68 AA 10                 initproperty  	private:_label
5E E2 0F                 findproperty  	private:labelChanged
26                       pushtrue
68 E2 0F                 initproperty  	private:labelChanged
5D F1 04                 findpropstrict	:invalidateSize
4F F1 04 00              callpropvoid  	:invalidateSize (0)
5D C1 02                 findpropstrict	:invalidateDisplayList
4F C1 02 00              callpropvoid  	:invalidateDisplayList (0)
5D F7 03                 findpropstrict	:dispatchEvent
5D 13                    findpropstrict	flash.events:Event
2C 97 02                 pushstring    	"labelChanged"
4A 13 01                 constructprop 	flash.events:Event (1)
4F F7 03 01              callpropvoid  	:dispatchEvent (1)
47                   L0: returnvoid
0 Extras
0 Traits Entries

As you can see, it actually shows the names of classes, properties, and methods, and isn’t that unintelligible, especially once you begin to understand the bytecode instructions. Now that anyone can disassemble anybody else’s SWF, I guess this means that the market for a good AS3 obfuscator is going to heat up!

The open-source Flex SDK project just went live!

http://opensource.adobe.com

What’s up with the open-source Flex SDK project?

Last June we announced that with the release of Flex 3, the Flex SDK would move to an open-source development model. In the meantime we rolled out our Jira-based open bugbase at http://bugs.adobe.com/flex. But we’ve also been busy on a lot of other open-source infrastructure. Fortunately, you don’t have to wait much longer to see it! Here’s a rundown on what’s coming soon.

We’ve set up a Subversion repository to hold the code. You’ve already been able to see the ActionScript code for the runtime libraries such as framework.swc and rpc.swc in our SDK downloads. But now all the Java code for the author-time command-line tools will be available in the repository as well. This includes

* the ActionScript 3 compiler
* the MXML compiler
* the fdb debugger
* the swfutils library

The swfutils library provides Java classes that can read and write the SWF file format for Player 9, including the ABC blocks that contain the AS3 bytecode.

All this code is being made available for your use under the Mozilla Public License, so start thinking about what you could do with it!

We’ve built a website for the Flex SDK open-source project that explains

* how to get the code
* what’s where inside the project
* how to build and test it
* how the project is governed
* how you can participate

Of course, it also provides downloads of daily builds.

If you want to be just a passive observer, you can watch as we develop Flex 3.0.1 and Flex 4. The Subversion log will let you see what we’re doing. You can subscribe to a “Commits Forum” to receive an email notification every time someone commits a change into the repository. Alternatively, you can get a periodic digest or just read the forum. If you notice a change that you care about, you can diff two versions of a file to see exactly what changed.

If you want to be an active participant, you can

* file bugs and enhancement requests
* submit code patches that fix bugs and implement enhancements
* request committer privileges

Anyone can submit a patch via our bugbase once you’ve agreed to some legal stuff. The project team will evaluate your patch and decide whether to apply it to the repository.

By the way, patches don’t have to be to code. The Language Reference documentation (“ASDoc”) is generated from comments in the source files, so this is patchable too.

Committer status is of course a privilege, not a right, and we won’t be granting it to just any schmo who asks for it. But we’d love to find the right developers who are passionate about Flex and have the skills and judgement to work on the code without close oversight. The best way to be considered for committer status is to submit useful, high-quality patches!

Finally, in addition to the Commits Forum, there will be a new Flex SDK Developer forum and one for discussing how the project works.