Archive for February, 2010

Flex Warning: CSS type selectors are not supported in components: 'ColumnChart'

Tuesday, February 23rd, 2010

If you get the error/warning in Flex “CSS type selectors are not supported in components”, you are probably using Type selectors in your.css style sheet that are being referenced by a custom component (as I was), which throws a warning.
No effect was seen in the AIR app, but apparently it can cause problem is deployed in a browser. Changed the Type selectors to Class selectors, and it resolved, see my code below.

If your exporting as3 as a SWC component library, you have to name your styles.css file defaults.css, see Livedoc article and
Parallaxed.net article for more details of both.


[styles.css]
// Incorrect: using 'Type' selector:
ColumnChart{
  maxColumnWidth: 30;
}
// Correct: uses 'Class' selector
.columnChartStyle{
    maxColumnWidth: 30;
}

[MyColumnChart.mxml]
// dont tag the .css file here
<?xml version="1.0" encoding="utf-8"?>
<mx:ColumnChart xmlns:mx="http://www.adobe.com/2006/mxml"
              showDataTips="true"
              visible="true" height="100%" width="100%">  </mx:ColumnChart>

[MainApp.mxml]
// Call the source style sheet within the mxml
<mx:Style source="APP/assets/styles.css"/>
// Tag the ColumnChart with the 'Class' selector
<mx:ColumnChart
     id="myChart"
     styleName="columnChartStyle">
</mx:ColumnChart>

Adobe Air to Exe – Packaging Air app in Windows executable

Tuesday, February 23rd, 2010

In AIR 2 you can build an EXE installer file for distributing an AIR application on Windows. I was getting a good few errors at the start trying this (it was a bit of a pain really), so to ease your experience of AIR to EXE, here are the steps I took to complete the process (btw, its just a fluke it worked out to 10 steps, only numbered it retrospectively!).

UPDATE: Serje Jespers created a drag-n-drop tool to accomplish this task, have a look here

I have a follow-up post also, to show how to package the AIR application EXE file, with the AIR runtime .EXE as a single setup file using InstallJammer! – link

Any Questions? Just drop a comment

Firslty, some of the command prompt error messages I was seeing.

  • -storetype is required
  • unable to create temp file in output directory
  • Java not a recognised command


1. Update your Air SDK from Air 1.x to Air 2 Beta 2(its in Beta 2 at the time of writing, but at least Air 2.0 is needed), and also install the Air 2.0 runtime.

2. Once downloaded, look up follow the steps carefully in How to overlay the Adobe AIR SDK for use with the Flex SDK.

3. In the app.xml file (or whatever your .xml app file is called) in the Flex Builder project, you have to add the following line:

<supportedProfiles>extendedDesktop desktop</supportedProfiles>

Read full post with all steps …..

Flex: Process terminated without establishing connection to debugger

Thursday, February 4th, 2010

If you ever get the error “Process terminated without establishing connection to debugger” when running a flex app in debug mode, check that there are no Process instances of adl.exe running in Task Manager.

Once this process is ended, the app should run fine.

Wow! Directed Network Graphs available in VS 2010 – but no standalone viewer:(

Tuesday, February 2nd, 2010

VSTS 2010 includes an amazing tool to visualize network graphs based on the DGML (directed graph) xml format. From what i’ve seen, this xml format is almost identical to the commonly used GraphML format (as used by the java and flash based prefuse and flare), at least for the basic attributes (nodes, links, source, target etc.). The tool is part of the VS2010 Architecture Explorer, and allows developers to visualize relationships between code segements/classes.

Unfortunately, it appears that there is no standalone ‘graph viewer’ available outside of VS (microsoft missed out on a trick here, that would have been a brilliant app ability!). The best DGML tutorials and vids are available on the Skinner and Chris Lovett blogs, at least until VS comes out of beta.

On the bright side, iv’e read that DGML is powered by MSAGL - a Microsoft product for automatic graph layout ($99 for a limited time, otherwise $280).

Microsoft Charts (.Net) – Based on Dundas Charts

Tuesday, February 2nd, 2010

Microsoft Charting Component was released just over a year ago for .Net (ASP and WinForms), and is based on a cut down version of Dundas Charts API, from whom Microsoft have purchased the IP. The download, with a very good sample gallery, is avialable here. Having looked at all the examples, theyre not as smooth or interactive as the native Flex charts, but good enough all the same.

ASP.Net dashboard example and tutorial is available on Michael Ceranskis site.

According to Alex Gorevs blog, the charting components will be integrated into .Net 4 (he also has some good tutorials).