Using the Flex Framework source code in a project
June 17th, 2009
You would think that it would be fairly simple to include the Flex framework source code in a project, rather than using the framework.swc library. Simply include the [SDK]\frameworks\projects\framework\src folder in your source path and delete framework.swc from your library path, and you’re good to go, right? Well, it’s not quite that simple.
First of all, you also need to include the [SDK]\frameworks\projects\framework\assets folder, or you’ll get a lot of compile errors similar to this: “Invalid Embed directive in stylesheet – can’t resolve source ‘Embed(source = “Assets.swf”, symbol = “__brokenImage”)’”.
You’ll now be able to compile without any errors, but if you run your project it will throw this error – “TypeError: Error #1010: A term is undefined and has no properties.” – in StyleManagerImpl.initProtoChainRoots(). I’m not going to go into detail on why this occurs, but the root cause is that the compiler doesn’t find the default.css file in the [SDK]\frameworks\projects\framework folder. As a result the info() method in the generated* _[your_app's_name]_mx_managers_SystemManager file contains a line that looks like this:
mixins: [ "_ClassFactoryDemo_FlexInit", "_advancedDataGridStylesStyle", "_ClassFactoryDemoWatcherSetupUtil" ]
instead of like this:
mixins: [ "_ClassFactoryDemo_FlexInit", "_richTextEditorTextAreaStyleStyle", "_DividedBoxStyle", "_alertButtonStyleStyle", "_textAreaVScrollBarStyleStyle", "_headerDateTextStyle", "_globalStyle", "_ListBaseStyle", "_todayStyleStyle", "_windowStylesStyle", "_ApplicationStyle", "_ToolTipStyle", "_CursorManagerStyle", "_opaquePanelStyle", "_TextInputStyle", "_errorTipStyle", "_dateFieldPopupStyle", "_dataGridStylesStyle", "_DataGridStyle", "_popUpMenuStyle", "_headerDragProxyStyleStyle", "_activeTabStyleStyle", "_DragManagerStyle", "_ContainerStyle", "_windowStatusStyle", "_ScrollBarStyle", "_TextAreaStyle", "_swatchPanelTextFieldStyle", "_textAreaHScrollBarStyleStyle", "_plainStyle", "_activeButtonStyleStyle", "_advancedDataGridStylesStyle", "_comboDropdownStyle", "_ButtonStyle", "_HDividedBoxStyle", "_DataGridItemRendererStyle", "_weekDayStyleStyle", "_linkButtonStyleStyle", "_ClassFactoryDemoWatcherSetupUtil" ]
which is how it should look. In particular, the missing “_globalStyle” bit causes you app to break.
So you need to either include the [SDK]\frameworks\projects\framework folder in your source path, which will cause ‘overlapping source path’ warnings, or copy this file to another folder and include that folder in your source path. Personally, I just copy it into the [SDK]\frameworks\projects\framework\src folder, which accomplishes the same thing.
Now I know what you’re thinking. You’re thinking, “This is all wonderful, Douglas, but why would I want to do this in the first place? It works just fine to use framework.swc. Flex Builder sets up new projects so that this and other SWCs have a ‘source code attachment’. You can set breakpoints and step through the code, etc. Why do you need to actually compile the framework source code as part of your project?”
Well, in my case I’m doing this because, while all of that is true, it doesn’t seem that Eclipse’s ‘Mark Occurrences’ feature works with ‘source code attachments’. I rely heavily on this feature when I’m trying to figure out what code is doing, which is the whole purpose of this exercise in the first place.
But it seems as though there must be a simpler way to do this. If you know of one, please add a comment!
* If you aren’t familiar with generated code, try adding the ‘-keep’ option to your compiler options. Then recompile and look for a ‘generated’ folder your project’s main source folder. It will contain the ActionScript classes that are created based on your MXML files. These files are normally compiled into your project’s SWF then deleted. Turning on the -keep option simply tells the compiler not to delete them when it’s done with them.
Eclipse’s “Team – Ignored Resources” Ignored?
May 7th, 2009
I’m trying to use the Eclipse “Ignored Resources” preference so that I can maintain my own personal settings for Flex projects that I’m working on. Specifically, when I make changes to the .actionScriptProperties, .flexProperties & .project files, I want SVN to ignore them. We use the Subversive Eclipse plugin and these settings seem to have no effect on how it operates. When I go to Team | Synchronize with Repository, Subversive still lists these files as files that need to be committed.
If you have any idea on how to make this work, please add a comment!
The Boston Flex User group invites you to…
Where: Adobe’s Newton office – 275 Grove Street – Next to the Riverside MBTA station
When: Tuesday, May 12, 7:00 PM – All are encouraged to come at 6:30 or so, hang out before the meeting and enjoy Pizza etc. courtesy of Universal Mind.
Who: Alex Barnett
What:
SaaS Models: What does this mean for Flex developers?
Today, millions of Small Businesses are adopting the SaaS (Software as a Service) model. These businesses need their data to connect, synchronize and interoperate across the multiple back-office and front-office applications and services they use to run their business. How will this work? How can the cloud help Small Businesses get more out of their data and leverage the functionality of the cloud? What are the opportunities for ISVs and SaaS providers and Flex developers to connect and program against the Small Business data cloud? This presentation will describe how Intuit’s PaaS offering: the Intuit Partner Platform, is enabling a brand new class of cloud connected services, SaaS and RIA offerings for Small Businesses and partner with ISVs and SaaS providers to solve real problems for millions of Small Businesses. In this session we’ll also be demonstrating how Flex developers can use their skills to take advantage of this huge opportunity.
Presenter Bio:
Alex Barnett leads the developer relations team at Intuit, responsible for Intuit Developer Network (IDN) and developer engagement and evangelism for Intuit Partner Platform (IPP). Previously Alex was VP, Developer Community at Bungee Labs after spending five years at Microsoft Corp. in various community program management and marketing positions. Before joining Microsoft, Alex was at a director at a leading digital marketing and Web development agency (Bluewave) for seven years. Alex played professional cricket for eight years (Middlesex and Lancashire). He blogs at http://alexbarnett.net/blog and Twitters at http://twitter.com/alexbarnett.
Please RSVP @ http://bostonfug11.eventbrite.com
See you there!
Eclipse Plugins & Settings
April 26th, 2009
Here are some of the plugins and settings that I use in Eclipse. I’m putting this up here mainly for my own refererence, but you might find something useful…
- Plugins:
- AnyEdit
- FlexBuilder (of course)
- Subversive – SVN client
- Also, I’ll be looking into the PrettyPrinter plugin
- Preferences:
- General | Editors | AnyEdit Tools
- Auto-Convert tab: Select ‘Remove trailing whitespace’ and ‘Convert tabs to spaces’
- Convert tab: Set ‘Tab width’ to 4 and select ‘Remove trailing whitespace while convert’ and ‘Replace all tabs’
- General | Editors | Text Editors
- Select ‘Insert spaces for tabs’
- Select ‘Show line numbers’
- General | Workspace | Linked Resources
- One can define tokens here so that source code paths can be made relative.
- Ant | Editor
- Problems tab: Select ‘Ignore all buildfile problems’
- Flex | Editors | ActionScript Code
- Select ‘Keep imports organized’ and ‘Remove unused imports’
- Flex | Installed Flex SDKs
- Specify default SDK
- Team | Ignored Resources
- Specify resources that you don’t want committed to SVN
- General | Editors | AnyEdit Tools
- Project Properties:
- Flex Compiler | Additional compiler arguments
- -keep – Short for -keep-generated-actionscript
- Flex Compiler | Additional compiler arguments
Also, I put these settings into eclipse.ini:
–launcher.XXMaxPermSize
1024M
–launcher.XXMaxPermSize
1024m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms512m
-Xmx1024m
-XX:PermSize=128m
-XX:MaxPermSize=256m
Boston Flex User Group :: April 14 :: Mansour Raad :: Building Mapping Apps with the ArcGIS Flex API
April 2nd, 2009
Please join us for the next Boston Flex User Group meeting!
Where: Adobe’s Newton office – 275 Grove Street – Next to the Riverside MBTA station
When: Tuesday, April 14, 7:00 PM – We invite you to come at 6:30 or so and hang out before the meeting. Pizza and drinks will be provided by Universal Mind.
Who: Mansour Raad
What:
Mansour Raad will talk about using the Flex API for ArcGIS. This session will be very hands on – he’ll show us how to build mapping applications to thematically render parcels, etc. He’ll also show us how to extend the API for other mapping features such as clustering, labeling, and heat maps.
You can check out his blog at http://thunderheadxpler.blogspot.com/
Please RSVP @ http://bostonfug10.eventbrite.com/
See you there!
Boston Flex User Group Meeting :: March 10 :: Joe Berkovitz on Noteflight
February 26th, 2009
The Boston Flex User Group is pleased to announce…
Who: Joe Berkovitz
Where: Adobe’s Newton office – 275 Grove Street – Next to the Riverside MBTA station
When: Tuesday, March 10, 7:00 PM – Feel free to come at 6:30 or so and hang out before the meeting
What:
Joe Berkovitz, founder of music software startup Noteflight, will talk about the technical underpinnings and lessons learned in building a full-fledged music notation editor on the Flex/Flash platform.
Topics covered will include: MVCS architecture, audio synthesis, non-linear visual layout algorithms, and automated testing. A short excursion covering the new Moccasin open source framework for graphical editors might be worked in. And be sure to bring your Zippo lighter so you can hold it up and request “Free Bird”!
Prior to founding Noteflight, Joe Berkovitz was a Chief Architect at Allurent, Ruckus Network and Unveil Technologies. Even earlier, he was part of ATG for eight years developing many core components & originating a number of key ideas with patents granted or pending. Prior to ATG, Joe worked at Houghton Mifflin; Stratus Computer; and Bolt, Beranek and Newman, among others.
Please RSVP at http://bostonfug9.eventbrite.com/
See you there!
Boston Flex User Group Meeting Tuesday :: Eric Hilfer :: Flex Automation Framework
January 8th, 2009
Where: Adobe’s Newton office – 275 Grove Street – Next to the Riverside MBTA station
When: Tuesday, January 13, 7:00 PM – Please feel free to come at 6:30 or so and hang out before the meeting
Who: Eric Hilfer, Director of Software Engineering at Tom Snyder Productions
What:
The Flex Automation Framework
Automated testing is an essential component of developing and maintaining software applications created by large teams. Flex Builder Professional provides an extensive framework for recording and replaying GUI-level user interactions for automated testing of Flex applications. Although the documentation mostly references using HP Quick Test Pro as the recording and playback agent, the framework can be used by other commercial testing agents, like RIATest, or agents that you can build on your own. Eric will describe his own journey of adapting the automation framework for testing Timeliner® XE, a massive AIR application, and will share some best practices (and some not-so-best practices) for extending the framework beyond the core Flex components. Some powerful examples will be shown of using RIATest to run data-driven regression testing of Timeliner® XE.
Please RSVP at http://bostonfug8.eventbrite.com/
See you there!
Boston Flex User Group meeting :: November 11 :: David Coletta from BuzzWord :: Building an application for both Flex and AIR
November 2nd, 2008
Speaker: David Coletta
Topic: Building an application for both Flex and AIR
When: Tuesday, November 11, 2008, 7:00 PM
Where: Adobe’s Newton Office
David Coletta from the Buzzword group at Adobe Systems will be talking about how to build applications that run in both the Flex and AIR runtime environments, using substantially the same codebase.
More details @ http://bostonfug.org/
Please RSVP @ http://bostonfug7.eventbrite.com/
See you there!
Boston Flex User Group :: October 14th :: Brian O’Connor :: How to use Flex 3 & Cairngorm with LiveCycle Data Services 2.6
September 30th, 2008
Time: 7:00 PM, Pizza & drinks at 6:30
Place: Adobe’s Newton office
Speaker: Brian O’Connor, Principal Architect at Universal Mind
Come hear about the benefits of LiveCycle Data Services (LCDS) and how to utilize them properly with Flex & Cairngorm, including:
* The differences between BlazeDS and LCDS.
* The different services and benefits offered by LCDS.
* How to model your Flex Services using Cairngorm and Data Management.
* And much more!
Details at http://bostonfug.org
Source code will be made available after the presentation.
Please RSVP at http://bostonfug6.eventbrite.com/
See you there!
Chrome: Is Google becoming evil?
September 3rd, 2008
Dear Google,
Please change this!:
http://www.velvet.id.au/2008/09/03/google-chrome-terms-of-service/
(Google currently claims the right to publish anything you submit through Chrome.)
Thanks,
Douglas