ColdFusion & Flex Hosting

If you knew me, you'd know that this post is about the last thing you'd expect coming from me. However, after recent experiences, I can't help but put a word out for GoWest Hosting.

I've been focusing on a full-time job for the last 2 years now, and as a result, my consulting business has all but ceased to exist. I've maintained a dedicated server to maintain previous clients over this time, but financially, it just wasn't making sense any more. Therefore, I undertook the arduous task of transitioning clients off of it so I could get rid of it (and its expensive monthly cost) because I wasn't recouping the cost from hosting fees.

I've put this off for 2 years because the thought of finding a compatible hosting company to support the ColdFusion and database services most of my projects required plain scared me. With all the remoting-config.xml and services-config.xml (not to mention data-management-config.xml with LCDS) to setup I figured it was going to take a very understanding hosting company to maintain these sites.

I found just such a company in GoWest hosting. I have used other services in the past, and most recently an Adobe endorsed provider for the Austin Flex User Group site (I won't mention names, but it shouldn't be too hard to track down who they are). The service and support from this (and other, but especially this) company was absolutely pathetic. I've found that too often these days it's easy to just expect sub par services and support because it seems to be becoming the norm... and so you just deal with it and think 'hey, it could be worse i guess'. Seriously though... a lot of times customer support is literally becoming an afterthought (eg. Dell's troubles in the past few years, and their 180 reversal to try and gain back disgruntled customers).

When I first contacted GoWest to ask them if they could support what I needed, not only did I get a quick response to the positive, but also an offer to setup a trial account and test it out before committing to a hosting plan. I took them up on this offer, and in fact their system did support what we needed, and was easy... really easy... to setup. It literally took me 10 minutes to ftp contents directly over, backup and restore the database, and fire up the site. Not one glitch in the process, and all done through their control panel interface. I immediately sent them an e-mail stating my joy over this.

There was a bit more correspondence to come in setting up the ColdFusion services, and after a thread of about 30 emails back and forth we did get it working. Now, I'd like to step back and point out again, I hadn't given them a single dollar yet, and we could have potentially hit a roadblock in the setup which could have resulted in me saying 'thanks for your help, but I'm gonna have to look elsewhere'.

This didn't happen and everything got transitioned over just fine. GoWest is now the new hosting provider for my clients, and I know they're in good hands given the service I received during the process.

That's my pitch for the day... and hope that more Flex/CF developers read this and look to GoWest for their hosting... I know I will be in the future.

http://www.gowesthosting.com

What happened to drag in 3.4?

The major app i've been working on for the past 2 years has been happily progressing through the iterations of the 3.x framework in Flex, until 3.4. All of a sudden my drag operations stopped functioning correctly. To be specific, any doDrag() operation has died and my eventListeners for MOUSE_MOVE don't seem to be getting dispatched when a component is dragging.

I have deadlines, which means I've just moved back to 3.3 and won't have time to look into this right now.... as is usual...

But has anyone else had this issue?

trace() output stops working with -optimize=true

I guess this one could be filed under the 'guess that makes sense' category, but none the less was a bit of a head-scratcher to figure out.

Basically, I have a couple of external libraries which I'm using in my current Flex project. I was trying to use the global trace() function within these libraries, but there was nothing getting output. Wha? I was in debug mode... I have the debug player... this has worked before... wtf?

Skip back... about a month ago my Subversion provider did a major migration which caused me massive headaches, and basically, I had to wipe out all my projects, and check them out fresh from the new svn repository locations, instead of just updating the repo address. In doing this, I thought I got all my settings correct, but alas...

One particular Library project (the project in question above) had -optimize=true as compiler argument. I saw this and didn't figure it for the issue as you have the -debug argument, and -debug-verbose which deal with output stuff.

Finally, after googling/flexcodering/blog searching/etc... along with confirming my mm.cfg file and flashlog.txt setup was correct, I began trying stuff willy-nilly to get this fixed. That's when I discovered that -optimize=true does indeed prevent any trace outputs.

And that's the morale of this blog post :-)

Dynamic Datasources with Flex & LCDS

Here's some info from recent posts I made re: a feature I was trying to figure out using ColdFusion, Flex and LCDS... the ability to change the database being used by destinations for different client logins.

ORIGINAL POST:

I'm hitting a wall on a requirement for a Flex application which utilizes the LCDS version included with ColdFusion.

I have the project setup to use DAO's, Assemblers and ValueObject (cfc's) which I call from Flex via DataService implmentation and the fill(), getItem(), etc... methods.

I need to setup my ColdFusion layer to access multiple datasources from the same Flex application. However, because of the way LCDS gets called from Flex, it doesn't seem that Application or Session variables in ColdFusion persist when I set them. I was thinking I could just have the HTML (cfm) wrapper page for my Flex application set that, but it is not recognized when I go to make a fill or get call against the assembler.

I thought about passing the datasource as a parameter each time a call is made, but while that would work when I initiate fill and get methods, the sync methods are "invisible" and I wouldn't be able to append an argument to them.

So my issue is... how do I go about having ColdFusion read a dynamic variable to define it's datasource?




ANSWER:

Tom Jordahl provided the answer on this for me. Here's the solution:

1) Prior to implementing this solution, it's important to realize that because LCDS manages the data, switching datasources dynamically could potentially cause issues if there is overlap between identifiers on the records you are retrieving. In my case, I'm using GUID fields as primary key and identifiers in my destinations, so this is not a problem. However, for example, if you were to use an incrementing integer for the identifier, then you could feasibly have LCDS managing a record, which would match identifiers with a record if you switched datasources on the fly.

2) I'm using ColdFusion as my middle-tier layer, but this could be applied to any form by accessing the flex.messaging.FlexContext class within your solution of choice.

3) The solution involves extracting the ID value of Flex client which makes calls against your Destination. Grab the identifier by calling FlexContext.getFlexClient().getId() to get a unique key for the "session". I use the term "session" loosely, as it's really just representative of the particular swf instance which has been loaded with your Flex Application. However, the ID doesn't change and persists across all calls you make against your destinations.

4) On application load, make a call to your CF layer which gets the ID, and sets it to the Application scope of the CF server as follows:

<cffunction name="set" access="remote">
<cfargument name="datasource" type="string" required="yes" default="">
<cfset var clientID="">
<cfscript>
clientID = CreateObject('java', 'flex.messaging.FlexContext').getFlexClient().getId(); APPLICATION[clientID] = arguments.datasource;
</cfscript>
</cffunction>


The function above receives a unique string which I want to be my datasource of choice. You could call this "set" function again anytime to reset the Application variable for this "session".

5) The only other thing to do, is now access this Application variable for each datasource.

datasource="#APPLICATION[CreateObject('java', 'flex.messaging.FlexContext').getFlexClient().getId()]#"

6) The last consideration is that each connection that is made via Flex will be setting a new variable in the Application scope on the Coldfusion server. This is a pretty minor concern for me, and I'll just run a schedule to clear the Application scope once a day, but if you have a high volume of users, a better solution would have to be found.

Cool New Flex App

Check out this new cool new Flex app: Rombla.

Rombla is an online "no programming" site builder that enables designers to create fully-editable websites using simple visual editing tools and then share them with their clients to edit and maintain.

I was able to design and build a basic template in about 5 minutes and a full site in about 25. Some cool features but my favorite has to be the color scheme mixer where you can create your own palettes in Kuler then import them into Rombla. Then you can really experiment by changing layouts and navigation. You can literally change the entire look and feel of your site in seconds.

It's addictive for a designer and super easy and fast for clients to do their own edits - great for people who don't like getting caught up with endless text edits.

Check it out at: http://www.rombla.com/

Double click to edit DataGrid/List

After some brief searching on this topic I pulled up an entry from FlexCoders back in August of 2007 where Chris Huyler had figured out and put together a custom DataGrid to listen for a double click event rather than the default single click for itemEditor instances.

I needed both DataGrid and List support using this feature, so using Chris' example for DG, I modified for List as well.

All credit goes to Chris for figuring this out, and my thanks... here's an example of each below:

DataGrid

  package com.bm.custom_components
{
import flash.events.MouseEvent;
import flash.geom.Point;

import mx.controls.DataGrid;
import mx.controls.listClasses.IListItemRenderer;
import mx.events.DataGridEvent;

public class DoubleClickEditDataGrid extends DataGrid
{
public function DoubleClickEditDataGrid() {
super();
}

private var triggeredEditable:Boolean = false;

public function triggerItemEditor(event:MouseEvent):void
{
var r:IListItemRenderer = mouseEventToItemRenderer(event);
var p:Point = itemRendererToIndices(r);
if ( columns[p.x].editable != false )
{
if (!editable)
{
editable=true;
triggeredEditable = true;
addEventListener(DataGridEvent.ITEM_EDIT_END,
triggeredEditorEnd);
}
var dEvent:DataGridEvent = new DataGridEvent(DataGridEvent.ITEM_EDIT_BEGINNING,
false,
false,
p.x,
null,
p.y,
null,
r,
p.y);
dispatchEvent(dEvent);
}
}

private function triggeredEditorEnd(event:DataGridEvent):void
{
if ( triggeredEditable )
{
editable = false;
triggeredEditable = false;
removeEventListener( DataGridEvent.ITEM_EDIT_END, triggeredEditorEnd);
}
}
}
}

List

  package com.bm.custom_components
{
import flash.events.MouseEvent;
import flash.geom.Point;
import mx.controls.List;
import mx.controls.listClasses.IListItemRenderer;
import mx.events.ListEvent;
public class DoubleClickEnabledList extends List
{
public function DoubleClickEnabledList(){}

private var triggeredEditable:Boolean = false;

public function triggerItemEditor(event:MouseEvent):void
{
var r:IListItemRenderer = mouseEventToItemRenderer(event);
var p:Point = itemRendererToIndices(r);
if (!editable)
{
editable=true;
triggeredEditable = true;
addEventListener(ListEvent.ITEM_EDIT_END, triggeredEditorEnd);
}
var dEvent:ListEvent = new ListEvent(ListEvent.ITEM_EDIT_BEGINNING,
false,
false,
-1,
p.y,
null,
null); dispatchEvent(dEvent);
}

private function triggeredEditorEnd(event:ListEvent):void
{
if ( triggeredEditable )
{
editable = false;
triggeredEditable = false;
removeEventListener( ListEvent.ITEM_EDIT_END, triggeredEditorEnd);
}
}
}
}

Using external services-config.xml files and setting up on Mac

Problem:

I want to reference a remote instance of the services-config.xml file for a project I'm working on. I'm now developing on the mac platform (which I love) and need to figure out how to reference it.

Solution:

1) Connect to and "mount" the external drive on which the services-config.xml file resides.

Connecting to the remote drive via Finder by choosing Go -> Connect to Server or Cmd+K will give you access to the networked drive, but doesn't help you when you need to reference that drive (mapping in Windows) within the compiler settings in FlexBuilder. So...

Fire up Terminal and navigate to the root of your system, and then into your Volumes directory. Create a new directory here as follows:

mkdir [new_name]

Choose something relevant as the name as you'll be referencing it in a second.

Next, use the following command to "mount" your remote network drive to this new drive you've just created.

mount_smbfs //[userame]:[password]@[remote_server_url]/[drive]/ /Volumes/[new_name]

Each of the vars used here is pretty straight forward, but make sure you use the same when you reference the "mounting" location in /Volumes

You won't be returned with any confirmation of success, but if you don't get any error, then it's setup successfully.

Now, go back into FlexBuilder, and setup your services pointer to:

-services '/Volumes/[new_name]/ColdFusion8/wwwroot/WEB-INF/flex/services-config.xml'

or whatever your path may be.

FlexMDI is ported to FlexLib

So after a lot of hard work on the part of Ben Clinkinbeard over the past few months, the FlexMDI project has been moved into the FlexLib project maintained by Doug McCune and others.

As I mentioned, Ben's done a lot of shit to the project over the past few months (most of which I freely admit I don't know anything about and had nothing to do with :-) which he summarizes in his latest post release. I will say that I did have some border resizing functionality ready to add, but didn't quite make the deadline for this release. I'll be updating the FlexLib project with code in short order.

So a big thanks to Ben for continuing to drive this project. He just presented on this in part of his presentation at 360Flex in Atlanta so hopefully there will be a lot more folks that check out this little framework we put together.

Virtual Mapping in ColdFusion 8

I was setting up the ColdFusion 8 server on my new Mac Pro today and am using the development server now in lieu of IIS which I always used on my Windows dev boxes previously. When setting up a virtual directory, I'd always just set it up through IIS. Setting up virtual directories in ColdFusion was a bit of a change for me, and after an hour of head scratching when my CF mapping didn't work when trying to call CFM files through browser, I figured out the following to setup a virtual directory for built-in ColdFusion development server:

1) Open up the jrun-web.xml file located in ColdFusion8/wwwroot/WEB-INF directory.
2) Add a virtual directory mapping as follows:

  <virtual-mapping>
<resource-path>/cf/*</resource-path>
<system-path>/Users/meutznerb/Documents/dev_flex3/CFMiddleTier/</system-path>
</virtual-mapping>

3) Save the file, and restart the CF server instance.

The mapping above will now allow me to call files from

http://localhost:8500/cf/
and reference the CFMiddleTier directory in my Documents/dev_flex3 directory.

The trick was getting the directory path correct... starting from /Documents/... would not work, and required the full path with /Users/meutznerb/Documents/... to be defined.

That's my mac newbie tip for the day :-)

A Persistent/Interactive Tooltip in Flex

I came across a requirement at work a few weeks back which involved an "interactive" tooltip... We needed to provide a summary of information in the tooltip, but then provide a link button to a more detailed document.

I came up with the following example by creating some functionality around the DataGrid mouse movements to display a "tooltip" (in reality a Menu instance) at the mouse position. Rather than digging into the framework to try and extend the ToolTip class to make it "stick" when moused over, I realized we've got popup menu functionality like that already. Slap a custom menu item renderer in there, skin it, and you've got a mousable, interactive tooltip instance.

I could have gone the extra mile and created a custom DataGrid instance using this new functionality, but I'm lazy so I'm just going to post the instance I implemented and let you figure out how to implement it for yourself :-) The idea being that it could be just as easily implemented on any List based control, and even with a bit of work any component in the Flex framework. Just modify the renderer to fit the content you need!

Example Here

Source Here

Copy from DataGrid to Clipboard/Excel in Flex

A really simple example today for a pretty useful feature... being able to copy contents from a datagrid (or any structure which uses a dataProvider for that matter) onto the system clipboard, and into an application like Excel.

Excel is able to recognize an HTML table format and pastes the structure into appropriate cells. The following example is tailored to that type of structure, but can really be formatted to whatever needs you have by modifying the createHTML() (or more appropriately named) method.

View example here : Example

And source here : Source Code

Set "Loading" screen background color on Flex

If I had a nickel for every time I've looked at a Flex application these days and seen that dull, default greyish blue color...

So here's my tip for the day:

Check out the compiler arguments line in the Flex properties and add

-default-background-color #PUTYOURCOLORHERE

Easy to do, and then your Flex apps won't look like everyone else's anymore :-)

More compiler arguments are available if you'd like to get frisky...

http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=compilers_123_24.html

And better yet, check out Ted Patrick's blog on creating custom preloaders and be a real rock star.

http://www.onflex.org/ted/2006/07/flex-2-preloaders-swf-png-gif-examples.php

Flex Prominent on Webware 2007 Hits & Misses

It was nice to see that Flex was right up there with Google in the "Hits" category for 2007 with AIR from Adobe as well as the online photo editing site Picnik.

See Full List

A good indication of great things to come in 2008!

riajobs.com & riacareers.com

So let me start off by saying I'm not really fond of domain name squatters, but unfortunately I've become one of them :-)

I registered a couple of domain names back in 05 while doing contract work through recruiting agencies. It didn't take long for me to establish a sincere dislike for recruiters, and although I'm sure there are great ones out there, I feel the vast majority aren't qualified to do their jobs.

But enough about that...

I registered both riajobs.com and riacareers.com with the intention of creating a marketplace where developers could get in contact "directly" with employers... and vice versa... I noticed another site recently (www.nauglegroup.com) founded by Kevin Langdon and upon seeing it though "that's what I intended to do".

However, given time and commitment constraints, it hasn't happened yet, and probably won't for quite a while.

So that leaves me to ask the question, what/where/how can these be put to best use? I'd obviously love to sell them for a million bucks, but that's unlikely. I talked with John/Tom over at 360 Conferences about using them for their recent ideas on RIACommunity.

Does anyone else have thoughts on this topic?

Disable single button in ToggleButtonBar

So after a short period of searching, there doesn't seem to be a straight-forward way to disable a single ToggleButtonBar button instance... here's what I found worked:

UIComponent(tBBInstance.rawChildren.getChildAt(X)).enabled/disabled

Anyone find a clearer way?

Austin Flex User Group?

If you're interested in joining the newly formed Austin Flex User Group, please visit the following link to sign up for notifications on mailing list

Sign Up Here

Visit AustinFlex.org

So I've been settling down (ie. working constantly) nicely since arriving in Austin TX 2 months ago. The wife and I love the city so far, and only regret we haven't gotten out to see more of it. I've had the pleasure of talking to a few companies in town who are doing Flex development, and it's nice to still be part of a little slice of IT heaven after leaving the Bay Area (read Round Rock/Dell/IBM/etc...).

However, I made the mistake of kicking up some dust with the Adobe User Group folks a bit too soon after arriving. One of the top things on my list to do when getting here is to start up a Flex user group for the area. However, I have yet to find the time to actually do this... :-(

So here's the reason for the post... Anybody in the Austin area (that includes Dallas/San Antonio/Houston cause if the CA folks can drive an hour from SF to SJ, the Texas folks can drive 2) that would be interested in attending meetings?

So if you're from Texas, or know someone who is, forward/re-post/shout it out to me, so that I get my ass in gear... I'm not looking for justification (I'll do it eventually) just encouragement to move it up the priority list :-)

Installing CFEclipse/Subclipse plugins on FlexBuilder 3

A co-worker sent me this post for installing things through software updates. Issue is, trying to install through update sites would result in error:

Eclipse Modeling Framework (EMF) - org.eclipse.emf.codegen.ecore.ui (2.3.0.v200706262000) requires plug-in "org.eclipse.jdt.core".

Joao (Fernandes?) has posted the solution over on his blog:

Link Here

Note the comment I added about having to check a second option labeled:

'Eclipse Java Development Tools 3.3.1.r331_......' as well to get it to work.

Thanks Joao!

What is Adobe Thermo? - Answer: Designer/Developer Integration

Notes taken from the keynote at MAX:

- an RIA design tool

- allows designers to create rich internet applications with logic embedded

- allows them to wire up interactivity without working any code

- allows them to use dynamic data without having access to the data source

- seamless workflow for developers working with flex builder

- can access Flex source code for the design

- taking a layered image from photoshop, and importing the psd file into Thermo generates layout and code for that layout.

- converting artwork to components on the fly (wow, very cool)

- they take a rectangle graphic, right click, convert to a TextInput component, and it retained the text within the graphic (made default text of TextInput component), all style information on the graphic is transferred to component (including font styles)

- highlight multiple graphical elements, and converted the group to a list, and creates a design time data set with the selected images to power the list

- changed padding on list items, and an onion skin of original image placement was retained for reference but just with reduced opacity

- edited an item in the list in place, and added an event to it to go to a new state, applied a transition to the state change. The state change was a size change, and was able to preview the increase in size, with the transition effect applied. Added some text information underneath the new state, which had fade effects applied to it. Was able to stagger effect play times using a simple gantt chart type tool.

- automatically provides lorem ipsum text for testing, and can define the number of words to show for it.

- takes two selected rectangle and converts to a scrollbar instance (seriously?... no way...) Able to identify the different layers of the graphic selection as the different components of a scrollbar. Associates the new scrollbar with the list using a wiring handle to simply drag over the list that it should affect, binding the two components together.

- able to easily add new items to the design time data collection

- and it all just works... amazing... bring on the applause :-)

- thermo and flexbuilder share the same project format, meaning designers and developers can very easily collaborate during development cycle.

- can expect early alpha/beta next year (2008).

Google Analytics AIR Beta

Someone forwarded me a link to this today and I was absolutely blown away. I spend the majority of my time creating reporting dashboards for my current employer, and Google Analytics is very similar to the solutions we try to achieve at the office.

In addition, I use Google Analytics for stats tracking on my own personal sites, and while their interface for use is great, I love the fact that Nicolas has put together a Flex/AIR interface for this. I'll be getting involved in testing/giving feedback, and I'd encourage others to check it out and do the same. I'd like to think this blog appeals to the more "charting-oriented" of us, so hopefully there's a few of you who will enjoy this as much as I do... :-)

http://www.aboutnico.be/index.php/google-analytics-air-beta-sign-up/

MDI (windowing) Interface with Flex

I'm a bit behind the ball with this post after relocating to Austin Texas this past week, but better late than never.

I met Brian Holmes and Ben Clinkinbeard at the 360 Flex conference in Seattle back in August. After a lot of discussion over many beers at the Elephant and Castle at the hotel, we came up with the idea of collaborating together on a MDI interface for Flex. We'd all seen examples of the functionality but felt there was a real void in a robust (free) solution on that topic. So here we are a month later, and after many frustrating IM sessions in 3 different time zones we've released the first iteration of an open source solution.

I couldn't be happier with the way things have turned out, and am very much looking forward to expanding on this project, as well as starting others with these two guys. I'll leave the description of the project to Ben's post on the matter.

http://www.returnundefined.com/2007/09/announcing-flexmdi-robust-extensible-mdi-framework-for-adobe-flex/

Google Finance with Flex Code

So here's the code as I promised. There is still a minor bug I'm going to work out with the range drag to the extreme right, and will repost with updated code once fixed. But for now, enjoy.

Samples Index - Right click for source

ColdFusion 8 released

http://www.adobe.com/products/coldfusion/

A debugger... thank the gods!!!

Flex is Catching On... a conversation on the Train

More than a few times on my commute into or home from work, I see people plugging away on laptops, and wonder what they're working on. Sometimes, if I'm sitting directly behind them, I can make out the Eclipse IDE view, and immediately think "Hey, maybe they're working with Flex?"... I'm not peeping, or want to intrude by asking what they're doing (would be kind of rude no?)... but still wonder.

Then this morning, for the first time ever, I overheard a couple of guys above me discussing Flex. Well that's kind of neat isn't it... a sure sign that the Flex buzz is really catching on. I caught bits of the conversation, and the two guys (one with a background in Flash) had nothing but positive things to say about the framework, and ability to create "cool" things easily.

So a word of caution... don't sit close to me on the train if you want your privacy ;-)

"Flash Player Not Found" Flex Builder/Player patch

Mike Morearty has posted a fix for a FlexBuilder fix if you've installed FB3, or just the newest version of the Flash Player, and are all of a sudden seeing "Flash Player Not Found" when compiling your apps. Check it out here...

http://www.morearty.com/blog/2007/04/16/new-flash-player-and-also-a-flex-builder-patch/

Google Finance with Flex from Silvafug last night

So I gave a presentation at the Silvafug meeting at Adobe in San Jose last night on Flex Charting. I struggled on what to give the talk on up until about a week ago. I finally decided to continue with the basic range selection example I'd done a few months ago, and create a "Google Finance" app in Flex, with all (or almost all) the functionality that the Google app offers.

While the presentation was exciting and fun to do, I think my last minute prep, and the fact I haven't spoken in public for many many many years resulted in a less than stellar walk-through of the functionality involved. However, the experience and feedback gained from last night was HUGE. I realized how I can improve the presentation 1000% percent, and plan on doing so before I give my talk in Seattle at 360Flex on August 13th (at least that's the tentative date.

Today I'm posting the app for everyone to play around, but am holding off on posting the code until Seattle (I don't want to steal my own thunder). However, I fully intend to release both the code-base, and an associated swc file for everyone to use, and integrate their own data into this type of interface. Hopefully this might entice the fence-sitters to attend 360 in August if you're interested in this kind of stuff.

I will say that it's not complicated stuff... and everyone and anyone should be able to insert their own data, or adapt the UI to fit their own project needs.

So here's the app... (click the image to view)

360Flex Conference - Speakers List

Full speakers list and subjects have been released on http://www.360Flex.org. I'll actually be doing a sneak preview of my 360 presentation at the June 14th SilVaFUG meeting in San Jose (at least what I have ready by then :-) The content I'm looking at includes advanced interaction techniques around dynamic series, annotation and background elements, and a bit of geographical stuff... stay tuned! It's tough to come up with original material with all the great stuff Ely keeps coming up with though :-)

Flex Chart Annotations... Source and Example

I've finally posted my Flex Charting Annotation sample and source code over on my personal blog... http://www.visualconcepts.ca/blog/

360Flex Conference - Seattle

A quick note that I'll be doing a presentation at the 360Flex conference in Seattle from August 13th to 15th. More details to come as I finalize a topic. Looking forward to seeing even more talented/aspiring/curious Flex developers than we had in San Jose.

360 Flex - Seattle

Chart Milestones using annotationElements

I was asked about how to introduce milestones by a co-worker the other day and did up this little example to help her out. I realized then that for Flex beginners the dataTransform and annotationElements might be confusing, so hopefully this helps others out too.

A really basic example of using annotationElements and the dataTransform methods to transform horizontal axis values to coordinate values. It draws an HRule instance at the selected horizontalAxis point and provides a button to link to details re: the milestone point.

http://www.stretchmedia.ca/code_examples/chart_milestone/main.html

Chart Range Selector - Take Two

After the great feedback I've gotten from the previous post, I decided to add a tad bit more functionality... namely the ability to drag the upper and lower selected chart areas. Same link as before... just click and drag...

http://www.stretchmedia.ca/code_examples/chart_range_selection/main.html

Flex Chart Range Selector - Google Finance'ish

So I noticed some posts re: this type of component on flexcoders the other day, and being that I was bored at work on this sunny Friday afternoon, decided to give it a whirl. Right click to view source inside app...

http://www.stretchmedia.ca/code_examples/chart_range_selection/main.html



After I finished putting this together (in all of 45 minutes) I was as giddy as a little kid because it's just so damn COOL... Yeah, it doesn't have all the bell's and whistles that the graphing on Google Finance has, but still, can you imagine how long this effect would have taken to do in Flash?

Three words... "I love Flex"...

Have to give credit to Ely Greenfield (for his data generation function, and let's face it, for being The Man) as well as Doug McCune for his Dual Slider component (which is better than the one I did, which is why I used it here).

List Control - Disable Selection Color/Highlight

In putting together a List control this afternoon, I discovered an annoying little property about Lists... you can't "disable" the selection color that occurs on a list item when you "select" an item (click on it). For my purposes, my list needed to be selectable for dragging elements to re-order, but I didn't actually want to select a given item in the list. The order of items was all I wanted to impact the order of series rendering in a stacked column chart...

Anyway... the solution I came up with was to specify a selectionEasingFuction style which returned "0".


  


private function myEasingFunction(t,b,c,d):Number
{
return 0
}


Flex TimeEntry Component

SM_TimeEntry is a custom Flex controls that allows a user to quickly and easily enter a valid time into your applications. It supports multiple styling options, text sizing, 12 and 24 hour format, and keyboard interaction too.

View Here

Chart Offset Calculator

I got sick of doing the calculations to determine the offset values for my ColumCharts so I put together this little app to do it for me. Thought others might find it useful as well.

View Calculator >>

Thanks to Ely Greenfield (www.quietlyscheming.com) for the inspiration and calculations, and to Ben Lucyk (www.esria.com) for the suggestions on improvement (sample chart and code).

Export to Excel with Flex 2.0 and ColdFusion

Hi,

I didn't really find a suitable solution for exporting to Excel after a bit of searching through forums and blogs, so I came up with the following. I wanted to achieve seamless "click to generate a report" from Flex and have the file option dialog popup in the browser allowing me to open or save. Here's what I came up with. While I don't see any issues with the solution, I realize it's a bit of a hack, and would appreciate any CF wizards letting me know if this is going to create problems.

From Flex, I'm calling a CFC function with my data being passed back as an array. The CFC takes the data and stores it to an application variable in CF. I then send a trivial result back to Flex. On the CFC result inside Flex, I make a call to a template CFM file which uses the cfcontent tag to generate the excel file from an html table structure I build with the saved application variable data.

CFC

<cffunction name="exportToExcel" access="remote" returntype="any" output="true">
<cfargument name="data" type="array" required="yes" default="" />
<cfset session.exportData = #ArrayNew(1)#>
<cfreturn 'true'>
</cffunction>


Flex

if(event.result == 'true')
{
var request:URLRequest = new URLRequest(URLToCFTemplate);
flash.net.navigateToURL(request, "_self");
}


Brendan

Updated: Download the source files here - Download

Flex Framework Posters

So I'm very happy that Adobe provided everyone at MAX with a set of AS/Flex Framework/Class diagrams, but I've gotta ask... could you have made them bigger? :-)

Named Parameters in ColdFusion

Thoughts on MAX

Now that I'm fully recovered from my week in Vegas for Adobe MAX 2006, I thought I'd offer some thoughts on my first MAX (and Vegas) experience.

1) If you've never been to Las Vegas, and you travel there for a conference like I did, don't fool yourself into thinking you'll concentrate 100% on the conference while it's taking place. I made sure to plan my trip with a few days after the conference in which to explore and discover the sights, but still found myself sufficiently distracted during the first 4 days during MAX. It doesn't help when Adobe decides to throw a party on Day 3 over at the Palms Casino :-)

2) I'm the biggest hypocrite in the world for saying this (as a past smoker) but the city really needs to do something about the indoor smoking. Seriously... walking out of a presentation to find 3-4 people lighting up in the hallway in between presentation rooms was ridiculous. What's funnier is the perfume crap that the casinos pump into the air system trying mask it.

3) While the present

Adobe Flex Chart Annotations

A sneak peek into the Flex charting annotation project I'm currently working on at 'a company'... the company has been fantastic about allowing me to publicly release a lot of the development and ideas we're coming up with here. Moving forward in the next few weeks, I'll hopefully be able to release the code for others to use/critique/applaud... :)

Sorry for the large download size, and the fact it's still just a movie. I created this for a presentation by my colleague Bruce Boston for an Emetrics conference he attended and presented at last week. If you skip about half-way through you'll see the annotation portion.

http://www.visualconcepts.ca/blog/attachments/CNET Charts Demo.zip

MAX Vegas

So the first day of MAX has come and gone... fantastic to meet all the great people in the Flex community. Will post more later, but for now I'll throw up this link to my webshots.com account so you can all feel like you're here in person :-)

http://travel.webshots.com/album/555094730SqHbvq

Dual Slider Component

*****
NOTE

Have updated the link below to a newer version of the DualSlider. Fixed some buggy activity when going crazy with the slider, or mousing off the screen... Thanks to Michael Schmalle and Rostislav Siryk for their suggestions on making this component better. *****


This was something that started as a feature request, and ended up being a component I thought I'd share with the rest of you.



Not much expanation needed once you run the demo here:

View Demo - Right click in demo to view source

Adds a "scrollbar" below the span between a dual-thumb slider which is draggable. When the drag action takes place, both

Set Application State From Flex to URL

Although this didn't turn out to be difficult by any means, I thought I'd throw it up anyways...

I came across the requirement to save the current "view" or "state" into the URL (much like Google Maps does with their "Link to this page" feature) for my Flex 2.0 application. I ended up throwing together a solution that works the same way as Yahoo Maps does, using the a hash in the URL string.

From my Flex app, I added a function which called an external JavaScript function to reset the URL with the values I wanted added...

App.mxml (excerpt)
----------------------------------------------
private function changeDocumentURL():void
{
var urlString:String = "var1=test1&var2=test2";
ExternalInterface.call("myJSFunction", urlString);
}


Inside my HTML wrapper for my swf, I add my JS function that's getting called.

App.html (excerpt)
----------------------------------------------
function myJSFunction(newString)
{
location.replace('#' + newString);
}


When I make the call for changeDocumentURL() it sets the string of variables in urlString to the browsers url (but DOESN'T reload the page)

Browser URL now looks like: http://www.visualconcepts.ca/App.html#var1=test1&var2=test2

Now for the flip side... looking into the script used to initiate the swf object in our HTML wrapper page App.html there is already an entry for flashvars which we can simply append to:

App.html (inside the AC_FL_RunContent() JS function)
----------------------------------------------
var preLoadFlashVars = location.hash ? location.hash.substr(1) : '';
"flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + '&' + preLoadFlashVars


Back inside App.mxml file, accessing the input vars is simply done using:

App.mxml (excerpt)
----------------------------------------------
Application.application.parameters.var1
Application.application.parameters.var2


So simple, but so cool!

CF Flex Connectivity Setup

Good God... I don't think this could have possibly been more frustrating...

I finally figured out the method behind setting up the CF-Flex Connectivity this afternoon. I'd setup the default "ColdFusion" destination out of the box, with a minor adjustment to the channel uri setting a few weeks ago. However, I decided this afternoon that I would get it setup so that I could easily copy from my development environment over to production (both have CF and the CF Connectivity installed). So I wanted to setup two different destinations, one for my local instance, and one for the production instance.... that way when I was ready to deploy to production just test locally, and move it over if all was good.

The solution ended up involving the same version of the flex-gateway-config.xml file to be placed in each location, which had destinations for both the local development box as well as production box. Before moving over to production, change the destination to the production box, test locally, and if al

Flex 2.0 Officially Released

Well, it seems that the day we've all been anticipating has finally arrived. Word is starting to leak (although we all figured it was happening about now) about pricing structure and availabilities of Flex 2.0. I've got to say, I'm pleasantly suprised as it's come in at a price point a lot lower than I expected. In addition, it looks like there is a free "Data Services Express" option which will allow a single application (on a single CPU) but unlimited users... wow!

A link to Teoti Graphix's Blog (Michael Schmalle) for a bit more info. http://www.flex2components.com/f2cblog/2006/06/27/flex2-the-time-has-come-to-push-the-button-released/

And off to Adobe for the real deal:

http://www.adobe.com/cfusion/tdrc/index.cfm?product=flex

Let me just say, I'm really looking forward to the next year of

ComoboBox Renderer/Editor for Flex 2.0

*** Added a check for null inside the renderer... was written for b3, and Barry was kind enough to let me know it was throwing a runtime error in GA... thanks Barry! ***

Another one I had done the other day, and figured I'd post now that I've got the blood pumping on this Blog!

ComboBox Renderer Example

I'll try to start posting code in this in addition to the zip files, but I'll have to implement a rich text editor into this before I start... don't really feel like hand coding my code just to display right now. Also think I'll add an upload feature for attachments too maybe...

BTW, excellent job by Ray Camden on this CF Blog solution. Aside from having to upgrade my MySQL instance, this sucker was a breeze to setup... probably took all of 10 minutes to install and configure....

Loading, modifying, writing XML locally with Flex 2.0

Hi,

Here's a solution for loading a local XML file through HTTPService, viewing/modifying through a DataGrid control, and saving the updated XML structure back to the file. This example uses the CF Flash Remoting service and RemoteObject tags to tie into a CFC which does the server-side writing of the file.

You can download a zip file of the solution here:

Download Zip

BlogCFC was created by Raymond Camden. This blog is running version 5.005.