Stretch Media
home services Solutions news about us Blog contact us

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.

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

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?

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