I’ve recently seen some confusion about how to get code from Adobe Labs. Whenever I post about code in the Adobe Labs source code repository, I usually link into the source code browser. For instance, if I’m talking about the ActionScript 3 PNG encoder, I’ll usually link to this. Copying and pasting from the source code repository is definitely not the recommended way to grab this code. The source code repository is only for reading the code online. Trying to copy and paste from it will result in horrible formatting and line numbers which will take you a fair amount of time to fix (and these libraries are all about letting you build apps quickly).
There are three good ways to grab the Labs source code. They are all described on this page on the Labs wiki, but I’ll go over them here, too:
- You can check it out using an SVN client. If you want to be able to keep grabbing the latest and greatest, and you already use SVN as part of your development workflow, this option should work well for you. Just run: "svn checkout http://labs.adobe.com/subversion/flashplatform/".
- Get the daily build. I have a cron job that builds a zip file of all the code every night. You can download the zip file here.
- If you insist on using the source code browser, when you find a class that you want, click on the "text" link rather than the class name to get a text version. The text version preserves the original formatting and doesn’t add line numbers.
There’s some good code in there, so enjoy it.