April 8th, 2008 by Kyle
Tags: , , ,
Posted in: Flex

The flex docs show how to use a DateField component as a Datagrid itemEditor. But what if your date data is actually a string instead of a date object? The sample below shows how to code a custom itemEditor extending the DateField component that allows you to do this. (I have also show how to use the drop in DateField as an editor for Dates.)

This movie requires Flash Player 9

Download a zipfile containing the source to this sample.

Browse the source of this example.

Or continue into the blog entry to see the source:
Read the rest of this post»


2 Comments »

March 24th, 2008 by Kyle
Tags: , , ,
Posted in: Flex

Here is a sample that demonstrates what to do if you have an itemRenderer that has scrollbars and the outer control has drag and drop enabled. If you just try and scroll the scrollbar of the itemRenderer, the dragging mouse movement activates the drag functionality. That’s not what you want! You want to be able to drag the scroll thumb to scroll the inner renderer.

The sample shows how to use stopImmediatePropagation() to halt the dragging and allow the scrolling:

This movie requires Flash Player 9

Download a zipfile containing the source to this sample.

Browse the source of this example.

Or continue into the blog entry to see the source:
Read the rest of this post»


No Comments »

March 11th, 2008 by Kyle
Tags: , , ,
Posted in: Flash Player

I thought this was a very important notice that I should bring more attention to:

Preparing for the Flash Player 9 April 2008 Security Update

“Adobe is planning to release a security update for Flash Player 9 in April 2008 to strengthen the security of Adobe Flash Player for our customers and end users, and to provide further mitigations for previously disclosed vulnerabilities. The Flash Player security update provides further mitigations for issues listed in the December 2007 Security Bulletin ABSP07-20 for DNS rebinding and cross-domain policy file vulnerabilities, and Security Advisory APSA07-06 for cross-site scripting vulnerabilities in SWFs. Due to the possibility that these security enhancements and changes may impact existing content, Adobe is providing relevant information in advance to allow customers to better prepare for the pending release.

Customers are advised to review the upcoming Flash Player updates to determine if their content will be impacted, and to begin implementing necessary changes immediately to help ensure a seamless transition. This document provides an overview of the upcoming Flash Player changes, links to TechNotes, and relevant documentation to help you better prepare.”

Please read the full document and pay attention! This may affect you.

-Kyle


No Comments »

March 10th, 2008 by Kyle
Tags: , , ,
Posted in: Flex

This sample basically builds upon another sample I posted a while back.
It is pretty self explanatory - if you have multiple series in a chart, you may not want the clutter of viewing all the series, so this app demonstrates how you can extend the legend to toggle series on/off.

If you turn off all series in the app below (with the button at the bottom of the app), you can then toggle on/off the (multiple) series you desire to view by clicking on the legend item for the series you are interested in.

This movie requires Flash Player 9

Download a zipfile containing the source to this sample.

Browse the source of this example.

Or continue into the blog entry to see the source:
Read the rest of this post»


4 Comments »

February 28th, 2008 by Kyle
Tags: , , , , , ,
Posted in: Flex

Flex 3 has been out since Monday of this week and there are a lot of new learning resources available through the adobe website.

This is my favorite starting point:
http://learn.adobe.com/wiki/display/Flex/Getting+Started

Within that page is a “download projects” link that has some great Flex Builder example projects for various things:

http://learn.adobe.com/wiki/display/Flex/Download+Projects

* Building a simple RIA
* Exchanging data with a server
o PHP version
o JSP version
o ColdFusion version
o ASP.NET version
* Working with data
o PHP
o JSP
o ColdFusion
o ASP.NET
* Handling events
* UI layout
* Displaying lists
* Customizing components
* Multi-page apps
* Debugging

Also, slightly buried within the Getting Started guide is a list of compatibility issues:

http://learn.adobe.com/wiki/display/Flex/Backwards+Compatibility+Issues


No Comments »

February 27th, 2008 by Kyle
Tags: , , , , , , , ,
Posted in: Flex, LCDS

Here are some debugging tips I provided to a customer this week regarding debugging ant tasks that seemingly compiled a Flex app that used dataservices fine, but the app didn’t seem to get any data. The are generally useful, so I thought I would post them.

1. Try setting fork=”false” in your mxmlc and compc ant task, since forking the compile process will hide the stdout and stderr streams from the compile process and hide any errors or warnings that may be happening in the compile process, setting the fork to false will allow you to see any compile output in your console.

2. In your ant target echo out a formatted statement that would represent the equivalent mxmlc (or compc) commandline statement with all variables and relative paths, etc. resolved. Then you can use this echoed statement to run against mxmlc to help detangle yourself from ant to rule that out as a source of problems or rule out any pathing issues.
(Maybe you are not pointing to correct sevices-config.xml file?)

3. Make sure your dataservice tags and dataservice operations have fault handlers. (Maybe faults are being returned from the dataservice or the operation, but they are not being handled.)

4. Compile the Flex app with and run in the debug Flash Player. This should produce logging info in the flashlog.txt that is helpful for watching the network traffic between your Flex app and a server and may help narrow down the issue.
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=logging_125_10.html

5. Look in your LCDS install dir under resources/config at the services-config.xml. This file is a sample config file that has comments explaining the various settings. You want to look at the logging tag and enable more verbose serverside logging.

You should probably set the logging tag like this:

(This will log “Debug level” output to your servlet container’s logs.)
The default patterns are probably sufficient to start with, but this sample config file lists all the possible debug patterns. If the debug level does not result in enough info, you may want to try the “All” level.

6. Use a network traffic sniffing tool like Charles: http://xk72.com/charles/ to view traffic between browser and server.


No Comments »

February 21st, 2008 by Kyle
Tags: , , , ,
Posted in: Flex

I had been thinking of doing something similar since I had seen requests on Flexcoders and thought this would be a useful and doable thing, but Doug beat me to the punch:


Monkey Patching FlexSprite to list all event listeners on any Flex component


Also, a very nice use of FlexSpry


No Comments »

February 18th, 2008 by Kyle
Tags: , , , , ,
Posted in: Flex

Here is a sample that came about as usual, from working on an issue with a customer. I found I didn’t have a good example of a combobox itemEditor. This sample came about when moving from using a combobox as an inline editor to moving to a combobox within a custom component as an editor. Wrapping the combobox in a VBox within the custom component caused some errors and undesirable behavior. In order to wire up data and tabbing/focus behavior you have to remember you component should implement IDropInListItemRenderer and IFocusManagerComponent. See the following sample code and running sample:

App:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:XML id="xml" source="weather.xml"/>
    <mx:DataGrid id="myDatagrid" dataProvider="{xml.city}"
        variableRowHeight="true" editable="true" rowHeight="50"
        width="300" height="300">
        <mx:columns>
        <mx:DataGridColumn dataField="Location"/>
        <mx:DataGridColumn dataField="Climate" editable="true" editorDataField="value">
            <mx:itemEditor>
                <mx:Component>
                    <mx:ComboBox editable="true">
                        <mx:dataProvider>
                            <mx:String>Mild</mx:String>
                            <mx:String>Hot</mx:String>
                            <mx:String>Foggy</mx:String>
                            <mx:String>Rainy</mx:String>
                            <mx:String>Snow</mx:String>
                        </mx:dataProvider>
                    </mx:ComboBox>
                </mx:Component>
            </mx:itemEditor>
        </mx:DataGridColumn>
        <mx:DataGridColumn dataField="CloudCoverPercent" editable="true" editorDataField="value"
            itemEditor="CloudCover"/>
    </mx:columns>
    </mx:DataGrid>
</mx:Application>
 

Read the rest of this post»


11 Comments »

February 6th, 2008 by Kyle
Tags: , , ,
Posted in: Air

The MonkeyBadge AIR Application is an app that can be used to produce a "Badge Installer" for your Adobe AIR application. This app merely wraps the sample "badge" "bits" that come with the Flex3/AIR sdk and based on the processes described in the dev center article: Deploying Adobe AIR applications seamlessly with the badge install feature takes a few input parameters from the badge creator and outputs a "badge package" to a folder. More information, installers and source code for this application can be found at its Google Code home: http://code.google.com/p/flex-monkey-patches-monkeybadge/

OR

You can download and install this application from the AIR Badge Installer created with the MonkeyBadge Application, below:

[inline]
2 Comments »

February 4th, 2008 by Kyle
Tags: , , , ,
Posted in: Air

I have been working on a few Adobe AIR projects and along the way as I run into what I feel will be common pieces of functionality to many of the AIR applications I may write, I have been abstracting that functionality and breaking it out into various Flex library projects. After reading the the Developer Center article on Managing Adobe AIR updates with ColdFusion 8, which helped me understand the general process, I decided to tailor the code that I was using in my current AIR application. What I came up with was a pretty simple approach. I decided to use information that was available in the application descriptor ([appname]-app.xml) for update purposes. In setting values for 3 of the keys in the application descriptor with deliberate usage in mind, the information necessary to deal with determining version dominance, location of the latest version info and installers would be readily accessible. I figured that if the current, running application was going to get it's version and update information from the application descriptor, then just having that information available in the same format somewhere on the web to download would make for a simple architecture. By using the "applicationID" and "appFileName" to construct a url to this "latest version" application descriptor, I could easily grab this XML and read from it the "appVersion" to compare against the current appVersion. If the latest appVersion is greater than the current appVersion, then the new application installer could be located at a url I contruct from the applicationID, appFileName and appVersion. Here is how I contruct these two URLs from keys within the application descriptor:

currentVersionInfoURL = "http://" + applicationID + "/"+ appFileName + "-app.xml";
currentApplicationInstallerURL = "http://" + applicationID  + "/" + appFileName + "." + appVersion + ".air";
From this, you can see how I use appFileName and appVersion. That is pretty straight forward. Each new AIR installer that I distribute will just follow this naming convention. The applicationID usage is a little less clear, but here is how I use it. For each application that I build, I create a subdomain off of my main domain. Then, I map that subdomain to a folder. When I create a new build for release, I increment the appVersion key in the application descriptor and in that folder, I place the latest application installer and the corresponding application descriptor. More details on this library can be found at its Google Code project home: http://code.google.com/p/flex-monkey-patches-upda-man/. Later this week, I will also be posting a useful little AIR application with source code that makes use of this library and should serve as a good sample for this functionality.
No Comments »

« Previous Entries | Next Entries »