Welcome to everflash.com Sign in | Join | Help

Flex MultiCheckComboBox sample

In a recent project I had the need of a control that could select multiple sub categories in a list with main categories and sub categories. This is typical hiarchical data that you could show in a treeview, but while it's rather flat (2-levels), I choose to solve it with a custom combobox control.

This comboxbox uses a custom itemrenderer that can select (by checking) sub categories. For main categories it shows a collapse/expand button, so you can collapse and expand parts of the list.

Have fun with the MultiCheckComboBox example (source included).

posted by Richard B. | (Comments Off)
Filed Under:

Flex 3.0 Clock example using PureMVC

It's been a while, but with the latest release of Flex, I thought I should give my blogging another try.

This time I used the Clock example to implement the Model-View-Controller design pattern with the PureMVC framework.

Go ahead, and take a look at the PureMVC Clock example (source included).

Nexttime I will try to do an example on the Model-View-Presenter design pattern, so keep a watch to this blog.

posted by admin | (Comments Off)
Filed Under:

Updated Cairngorm Clock Sample to Flex 2

Found some time to update the clock sample to Flex 2.  You can find it here, including the source.

posted by Richard B. | 4 Comments
Filed Under:

Horizontal scrolling Flex Tree Control possible solution

It's been a while, but finally I have the oppertunity to use Flex in a real world project. The project is going to be a CMS for kiosk applications. This is similar to a CMS for a website, but the content in this case has to be distributed across the internet to hundreds of kiosks. For this project I will do the interface in Flex / Flash, with a backend in .Net 2.0 (C# and webservices). This idea has been around now for about 6 years and I think with Flex 2 I finally have the means to create a CMS with a real WYSIWYG user interface.

Anyway, this blog entry is about the Flex Tree Control. A good CMS can't do without a couple of tree controls. But having a tree control that did not scroll horizontal properly, was a bit dissapointing. The problem with the Tree Control is that there is no measurement of the horizontal width of induvidual nodes. I tried to solve this by doing the measurement on all visible items in the tree. It worked out ok I think, although it's probably not a universal solution to the problem. Take a look here (source included).

posted by Richard B. | 1 Comments
Filed Under: ,

Flex 2.0 & Cairngorm 2.0 sample : Cairngorm Clock

When you start building Flex applications, you will soon discover that you are going to need a structured way for building a complicated, real-world web application. Same with me...

Comming from the .Net world, I decided to do some investigation in design patterns for Flash and Flex applications. After some googling around, I found a sample chapter from Colin Moock's book on Essential ActionScript 2 which describes the Model-View-Controller design pattern. In this chapter, Colin Moock builds a Clock application based on the MVC design pattern.

Just when I thought the MVC pattern could be usefull for me, I got the posts about the Cairngorm 2 framework for Flex 2. This framework builds on well-known design patterns, including the MVC pattern.

I decided to combine these 2 sources of information and rebuild the Clock application in Flex 2 using Cairngorm 2. You can find it here, including the source.

Have fun !!!

posted by Richard B. | 1 Comments
Filed Under: ,

Flex LinkBar customization

I did some flex component customization today. In my application I am using a LinkBar that needed a different look-and-feel.

After some investigation I was able to do this, but not the way I would like to do it.
First of all: I used a Dataprovider to provide the LinkBar with the links it should render. Initially I thought that I could set more style properties on the dataprovider items, to change the look and feel of the LinkBar.

This is apparently not correct. What you can do for example is set an icon for each Link that gets created. This is fine, as long as you do not want different up and down icons for each Link created. I need more flexibility.

To solve the problem, I used the childAdded event of the LinkBar to set style properties for each Link that is created.

Please have a look at demo and it's source.

Btw: this example uses a AssetManager Class to serve up the graphical resources for the LinkBar. Found it somewhere on the net, but I do not remember where, so I can not give somebody kudos for it, sorry, please let me know if it is you :-)

posted by Richard B. | 1 Comments
Filed Under: ,

Start building Authenticated Webservices for Flex

Today I did some investigation on how to do authenticated webservices for flex. I looked at the Flickr Photo Viewer and the Flickr API. I think this is a very nice architecture for doing authenticated webservice calls.
It works something like this:

- User wants to perform some call to a webservice that requires authentication.
- Application needs an authentication token.
- User logs into the system
- User gets a token via WebService
- User calls the webservice with the authenticated token
- Webservice checks if the token is still valid
- Webservice performs call and resturn result.

So, back to the keyboard and start building this... to be continued. !

Update 14-feb-2006

After some investigation I decided that I will follow a different approach.
I will not use any authentication token, but instead I will use the FormsAuthentication, combined with server caching mechanism, that comes with ASP.NET.

posted by Richard B. | (Comments Off)
Filed Under: , ,

Flex WebService beta bug busting

Today I struggled with the mx.rpc.soap.WebService class. What I wanted to do is call a .Net WebService method that has 3 arguments:

Authenticate(Username:String, Pwd:String, RememberMe:Boolean):String

This might look simple and it is, when you know which bugs to avoid. 

I started out with this function:

public function AuthenticateUser(strUsername:String,strPwd:String,blRemember:Boolean):String {
   var ws:WebService = new WebService();
   var op:AbstractOperation;
   ws.wsdl = wsdl;  
   ws.loadWSDL('yourwebserviceWSDL'); 
   ws.useProxy = false;     
   
   op = ws['Authenticate'];  
   ws.addEventListener("result",doResults);  
   ws.addEventListener("fault",doFault);  
    
   op.send(strUsermame,strPwd,blRemember); 
 }

This should do the trick,... but it didn't. After tracing what happened in the webservice call I noticed that the argument values get mixed up with the argument names in the final SOAP call. Took me a good part of the day to figure this out....(this might be my own shortcomming :-))

Once I found the bug, a solution was easy to create, this is the final function:

public function AuthenticateUser(strUsername:String,strPwd:String,blRemember:Boolean):String {
 var ws:WebService = new WebService();
 var op:AbstractOperation;
 var args:Object = new Object;
 
 args.Username = strUsername;
 args.Pwd = strPwd;
 args.RememberMe = blRemember;
  
 ws.wsdl = wsdl;  
 ws.loadWSDL('yourwebserviceWSDL'); 
 ws.useProxy = false;    
  
 op = ws['Authenticate'];  
 ws.addEventListener("result",doResults);  
 ws.addEventListener("fault",doFault);     

 op.arguments = args;
 op.send();
}

Lessons learned: do not trust the Webservice API to map your arguments into a SOAP call, do it yourself !

Having this, next up will be to create an authentication module that can be used in a web application... , going slow but steady.

posted by Richard B. | (Comments Off)
Filed Under:

Flex 2 Beta 1 ... a learning experience

Hi all,

I've started the learing curve on Flex. I am a Flash developer from version 3, but never really used Flex or FCS. This is mainly because there was never a real need for using these products.

But things have changed. I have build a .Net web application for the company I work. It is currently at version 3 and it's doing pretty ok. The problem is that the UI is not as sufficient and efficient as good be. I think the application could be a top class RIA if the UI is modified.

At the moment I use a mix of technologies, like Flash, ASP.NET, webservices and some custom made tools. I'm thinking about doing the UI in Flex. Having no experience in Flex, I think it's time to start learning !

I am planning to keep this blog updated with my learning experiences and the rebuild of the web application.

Keep watching !

posted by Richard B. | (Comments Off)
Filed Under: , ,

Blog up !!!

Yes !!! Blog is up ! I installed Community Server from Telligent Systems and it's great !!!

At the moment I will only use the blog part of Community Server. Installation of the application is a real breeze. It took me about 10 minutes to install and get this blog up and running.

It's got a shipload of administration and moderation features, which will definitily come in handy in the fututre.

I hope to write some blogs about Flash, Flex and .Net, so keep watching this.

See ya !!!

posted by Richard B. | (Comments Off)
Filed Under: