How to share your Flex code

Sharing your source code is easy in Adobe Flex 2. After a quick glance at the Application class in the Flex API, you”ll find that the viewSourceURL property will allow you to open a new browser window at which your source would be stored. You could point it to a specific file or zip as well as a directory. Either way, you are able to share your code with very little effort.

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"


UPDATE: For Flex Builder 3 they added a simple selection option that will include the source for you. Select from the menu bar Project > Export Release Build… And then in the dialog, check the box for including source and select the objects you’d like to include.

Thanks Jason for reminding me to update this post.

About Rob Rusher

In his role as Principal Consultant for On3, Rob leads an software development practice to help his clients build rich Internet applications for the desktop, browser, and mobile devices, and to rapidly increase their knowledge and skills to better support their organization's goals. Rob is an Adobe Certified Expert, Community Professional, and Certified Instructor. He has taught and mentored the technical teams at HP, Overstock, Paychex, SAS, the FedEx, and other Government and Fortune 100 organizations. Rob has co-authored four best-selling books on building secure, cutting-edge and rapidly developed applications using Adobe AIR, ColdFusion and Flex. He is very active in organizing and speaking at RIA, Adobe LiveCycle, mobile conferences, and user groups. In addition to growing his software consulting practice, On3, Rob has been building expertise in rich client application development on a wider variety of devices and platforms that extend the applications to change the way we all create and live.