Monday, November 24, 2008
Flex Profiling gotcha when using framework RSL
I recently started using the Flex framework RSLs to reduce the size of our SWF, then just yesterday I tried to run the profiler on it and got a "Profiling can only be done on debug versions" error. My SWF was built for debug so I couldn't understand why I was getting those errors. It took me a while but I finally found a blog post that pointed out the obvious: the RSLs are release builds. So to profile my app I had to turn off the RSLS (use Merge into Code option).
Friday, November 21, 2008
Tuesday, November 18, 2008
Adobe MAX day 1 - Sessions
Looking Ahead to the Next Version of Flex
It'll compile much faster, have better workflow for developers and designers, and show a significant change in the evolution of the framework.
Looking Ahead to the Next Version of Flex
Main improvement areas: workflow, framework evolution and compiler performance.
Catalyst: Helps designers turn artwork into components. It's currently difficult to customize components beyond reskinning them. Will improve workflow between developers and designers.
Spark Architecture: New classes using FxComponent as base class to replace Halo classes, though FxComponent is derived from UIComponent. Moves all UI related funtionality in code and out of markup (MXML). This makes the classes much more easily extensible since substituting new skins will be more powerful.
In order to support more tightly integrated skins graphics primitives were made first class citizens. As a result MXML components like Line, Rect, etc. can now be animated.
Introducing FXG interchange format.
'State' syntax changed to allow more powerful state capabilities.
mx.core.Container replaced by mx:Group. ?
New Layout base class divorces layering from child order. Much applause!
Talks about two-way data binding.
Performance enhancements: 2x to 5x speed improvements in compiler.
The Flex Architecture Faceoff
Dissapointing overall, mostly complained about various frameworks like Cairngorm. Half of the speakers prefered good code generation over frameworks.
Why do projects fail:
- Overuse of patterns. Engineers trying to use patterns where they don't belong.
- Overuse of singletons. Everythings a singleton, leads to spaghetti-code.
- People don't think they need programming expertise for Flex.
Enterprise Design (?) architecture design tool.
Watch out for overuse of data-binding, very hard to clean up, bad performance.
Prana Framework (http://www.pranaframework.org) Inversion of Control/Dependancy Injection tool.
Use code generation for back-end work.
Advanced Tips and Tricks for Flex Builder 3
+ Stay up-to-date with latest Java JVM. 1.6 is much faster starting up Flex Builder than earlier versions.
+ Flexbuilder.ini bump memory settings.
+ Use Team->History for SVN access.
+ Use profiler! QueueElement method used by DispathLater sometimes accumulates memory.
+ Use CSS features whereever possible.
+ Ctl-x/clt-y - shift case of selection.
+ Ctl-shift-p - find matching braces.
+ Ctl-n - open new editor.
+ Ctl-d - delete current line.
+ Use framework RSL linkage to reduce SWF size. Caches Flex framework code. Note: can't profile when in this mode.
Coldfusion Powered Flex
It'll compile much faster, have better workflow for developers and designers, and show a significant change in the evolution of the framework.
Looking Ahead to the Next Version of Flex
Main improvement areas: workflow, framework evolution and compiler performance.
Catalyst: Helps designers turn artwork into components. It's currently difficult to customize components beyond reskinning them. Will improve workflow between developers and designers.
Spark Architecture: New classes using FxComponent as base class to replace Halo classes, though FxComponent is derived from UIComponent. Moves all UI related funtionality in code and out of markup (MXML). This makes the classes much more easily extensible since substituting new skins will be more powerful.
In order to support more tightly integrated skins graphics primitives were made first class citizens. As a result MXML components like Line, Rect, etc. can now be animated.
Introducing FXG interchange format.
'State' syntax changed to allow more powerful state capabilities.
mx.core.Container replaced by mx:Group. ?
New Layout base class divorces layering from child order. Much applause!
Talks about two-way data binding.
Performance enhancements: 2x to 5x speed improvements in compiler.
The Flex Architecture Faceoff
Dissapointing overall, mostly complained about various frameworks like Cairngorm. Half of the speakers prefered good code generation over frameworks.
Why do projects fail:
- Overuse of patterns. Engineers trying to use patterns where they don't belong.
- Overuse of singletons. Everythings a singleton, leads to spaghetti-code.
- People don't think they need programming expertise for Flex.
Enterprise Design (?) architecture design tool.
Watch out for overuse of data-binding, very hard to clean up, bad performance.
Prana Framework (http://www.pranaframework.org) Inversion of Control/Dependancy Injection tool.
Use code generation for back-end work.
Advanced Tips and Tricks for Flex Builder 3
+ Stay up-to-date with latest Java JVM. 1.6 is much faster starting up Flex Builder than earlier versions.
+ Flexbuilder.ini bump memory settings.
+ Use Team->History for SVN access.
+ Use profiler! QueueElement method used by DispathLater sometimes accumulates memory.
+ Use CSS features whereever possible.
+ Ctl-x/clt-y - shift case of selection.
+ Ctl-shift-p - find matching braces.
+ Ctl-n - open new editor.
+ Ctl-d - delete current line.
+ Use framework RSL linkage to reduce SWF size. Caches Flex framework code. Note: can't profile when in this mode.
Coldfusion Powered Flex
Adobe MAX day 1 - Keynote
Well, my first time blogging an event. Catching up with the rest of the world.
The most exciting thing at the keynote was the enormous wrap-around screens across the front of the room. Other than that there was no one thing that really stood out. It started with a pretty cool DJ'ed audio/visual/scratching presentation and then moved on to demos of various products. The emphasis was on Flash 10 and other new and updated Adobe products of course. The new text formatting capabilities of Flash 10 were showcased in a very slick New York Times Air app. Can't wait to try it out. They showed Adobe Wave, sort of a notification agregator for IM's, Diggs, email etc.
They demoed Cocomo, a social networking/multi-user service, by showing an app that facilitates medical peer reviews in a strange skit with a very busy doctor.
Devices, devices devices. Adobe recognizes the importance of non-computer devices, more people connect to the internet through phones etc. than through computers, so getting Flash onto as many devices as possible is critical to them. They want it on 1 billion of them by 2009. Flash needs to be easily updatable on these devices, ie. it can't just be burned into them at manufacture time. Full Flash 10 will be on high end devices, Flash Lite on lower end devices. Kevin Lynch then spent about 20 minutes juggling an armful of various devices, showing a music service, YouTube videos, some tablets that were "screen aware" so he could "throw" images from the tablet up on to the big projector screen on the stage, pretty cool though I don't know how useful that would be.
There was a genuine celebrity sighting. Maria Shriver came out to talk about the "California Trails", very interesting, but where's Arnold?
Andy Rubin from Google made a brief appearance to declare that the idea of having Flash on Android devices warms his heart.
Kevin tried to demonstrate how easy it is to install Flash Lite on a Samsung device but the WiFi failed.
BTW, I'm staying at the Hotel Palomar, which is fantastic but their WiFi is real slooooow.
The most exciting thing at the keynote was the enormous wrap-around screens across the front of the room. Other than that there was no one thing that really stood out. It started with a pretty cool DJ'ed audio/visual/scratching presentation and then moved on to demos of various products. The emphasis was on Flash 10 and other new and updated Adobe products of course. The new text formatting capabilities of Flash 10 were showcased in a very slick New York Times Air app. Can't wait to try it out. They showed Adobe Wave, sort of a notification agregator for IM's, Diggs, email etc.
They demoed Cocomo, a social networking/multi-user service, by showing an app that facilitates medical peer reviews in a strange skit with a very busy doctor.
Devices, devices devices. Adobe recognizes the importance of non-computer devices, more people connect to the internet through phones etc. than through computers, so getting Flash onto as many devices as possible is critical to them. They want it on 1 billion of them by 2009. Flash needs to be easily updatable on these devices, ie. it can't just be burned into them at manufacture time. Full Flash 10 will be on high end devices, Flash Lite on lower end devices. Kevin Lynch then spent about 20 minutes juggling an armful of various devices, showing a music service, YouTube videos, some tablets that were "screen aware" so he could "throw" images from the tablet up on to the big projector screen on the stage, pretty cool though I don't know how useful that would be.
There was a genuine celebrity sighting. Maria Shriver came out to talk about the "California Trails", very interesting, but where's Arnold?
Andy Rubin from Google made a brief appearance to declare that the idea of having Flash on Android devices warms his heart.
Kevin tried to demonstrate how easy it is to install Flash Lite on a Samsung device but the WiFi failed.
BTW, I'm staying at the Hotel Palomar, which is fantastic but their WiFi is real slooooow.
Wednesday, June 18, 2008
Getting a button's icon size
I often want to set the size of an button based on the size of its icon but access to the icon can only be done through protected methods, so I wrote this simple component to expose the icons dimensions.
UtilButton.mxml:
Then the button's size can be set like this:
UtilButton.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.core.mx_internal;
use namespace mx_internal;
public function get iconWidth():int {
return getCurrentIcon().width;
}
public function get iconHeight():int {
return getCurrentIcon().height;
}
]]>
</mx:Script>
</mx:Button>
Then the button's size can be set like this:
<comps:UtilButton id="closeButton"
icon="@Embed('assets/CloseX.png')"
width="{closeButton.iconWidth + 6}"
height="{closeButton.iconHeight + 6}"/>
Thursday, April 24, 2008
Flex "Internal build error"
I started getting "Internal build error" messages whenever I build anything other than a one class Flex library. The log error from C:\work\workspace\.metadata\.log is:
I found a recommendation to re-install Flex Builder, so I've done that and got a "Product Extension not established automatically" error. Jeez. More detail:
Back to Eclipse and...success! The project builds properly!
!ENTRY org.eclipse.ui 4 0 2008-03-29 09:13:16.625
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at com.adobe.flexbuilder.exportimport.importwizard.FolderProjectImporter.findFile(FolderProjectImporter.java:107)
at com.adobe.flexbuilder.exportimport.importwizard.FolderProjectImporter.computeDeepPath(FolderProjectImporter.java:95)
at com.adobe.flexbuilder.exportimport.importwizard.FolderProjectImporter.validate(FolderProjectImporter.java:41)
at com.adobe.flexbuilder.exportimport.importwizard.ImportWizardPage.validatePage(ImportWizardPage.java:310)
at com.adobe.flexbuilder.exportimport.importwizard.ImportWizardPage$4.modifyText(ImportWizardPage.java:178)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:166)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:962)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:943)
at org.eclipse.swt.widgets.Text.wmCommandChild(Text.java:2366)
at org.eclipse.swt.widgets.Control.WM_COMMAND(Control.java:3801)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3675)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4351)
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:2179)
I found a recommendation to re-install Flex Builder, so I've done that and got a "Product Extension not established automatically" error. Jeez. More detail:
java.io.FileNotFoundException: C:\Program Files\Adobe\Flex Builder 3 Plug-in\eclipse\features\com.adobe.flexbuilder.feature.core_3.0.194161\feature.xml (The system cannot find the path specified)Clicked OK to let it finish anyway.
Back to Eclipse and...success! The project builds properly!
First things first
This blog will be about programming in Flex and other far-out technologies. A lot of it will be notes about problems I run into and solutions that I find.
Subscribe to:
Comments (Atom)