Actionscript

Flex Datagrid Percentage Width Columns


Posted in:

I have a multitude of tutorials on the Flex Datagrid here at Switch On The Code and none of them show you how to use percentage widths in your Datagrid. Now at the surface this seems really easy, but the way they implemented it in Flex is very unintuitive. So, today I am going to show you how to quickly get percentage based columns in your datagrid.

Read More Icon Read More

Flex DataGrid Custom Sorting


Posted in:

The Flex DataGrid is a very powerful and useful component but there are some things that it just won't do out of the box. One of the features that is built in but not used by default is custom sorting functions. The DataGrid will sort most basic object types by default, but if you have a complex object that you need to sort it has to be done using a custom function. This tutorial is going to show how to build and use a custom sorting function in a DataGrid.

Read More Icon Read More

Flex & PHP - Creating WoW Armory Search Widget


Posted in:

One of the neat things about World of Warcraft is the amount of data freely available. Between sources like Thottbot, Wowhead, and WoW Armory you can find information on just about anything in the game. The WoW Armory is even more interesting because it sends all of its data to the browser in xml. This makes it really easy to consume this data through web requests. This tutorial is about building a small application that searches the Armory for items.

Read More Icon Read More

Flex DataGrid Adding Rows using a Popup


Posted in:

When working with Flex one component almost always shows up, the DataGrid. Now it may not just be the DataGrid but any List based control. It is rare that I create any type of data driven application and not use one of these controls. Along with displaying information it is also useful to be able to add data. Today, I am going to go over a method that can be used for this task. The way we are going achieve data insertion is by using a popup that will hold a simple form to fill out.

Read More Icon Read More

Flex HTTPService - Retrieving Data From Flickr


Posted in:

There are many ways to retrieve data in Flex, one of the easiest and most used methods is utilizing the HTTPService component. Explaining how to use this object to gather photos from Flickr is exactly what this tutorial is about. Included is an explanation of how we can send requests and handle their results using simple http web requests.

Read More Icon Read More

Adobe AIR and Flex - Saving Serialized Objects to File


Posted in:

When creating any desktop application there is almost always a time when you need to store data on the computer. Now with Adobe AIR we have several options. One would be that we could use the built-in SQLite database support, for a small amount of data this is overkill. Another option is that we could turn the data into XML and write out to a file, the problem with this is that we we have to write some kind of decoder if we want a typed object. There is yet another option we have in Adobe AIR, we can serialize the object into a byte array and write it out to a file.

Read More Icon Read More

Flex Snippet - Using FlashVars


Posted in:

One of the many ways of getting information in Flash and/or Flex is using FlashVars which can be passed in through the embedding mechanism. This method is used for many different things. It can be used to pass in a video to play or a simple parameter you don't want to define at compile time. You can see examples of this all over the web in places like Google Finance and YouTube.

Read More Icon Read More

Flex and Actionscript Getting Class Information


Posted in:

A few days ago one of the other guys here on the blog talked about getting object information in C#, well today I am going to talk about doing the same basic task in Flex and Actionscript. This tutorial is going to take a look at two methods that will help get object information, describeType() and ObjectUtil.getClassInfo(). Both the aforementioned functions will return information about the object passed, they differ in how much information they return and how.

Read More Icon Read More

Flex Snippet - Using ChangeWatcher


Posted in:

One of the many features in Flex is Binding and it is a very important one at that. A feature that I feel is closely related (but that we have not yet covered here on the blog) is the ChangeWatcher class. The ChangeWatcher class does pretty much what the name says - it watches for changes on objects. Note that the properties that can be watched by the ChangeWatcher must be bindable - hence the connection to binding. Today I am going to give a quick rundown on how it works.

Read More Icon Read More

Dynamic Classes in Flex and Actionscript


Posted in:

I have known about dynamic classes in Actionscript for a while but I just recently started playing around with them. Basically they are declared classes that can have additional properties tacked on to them at runtime. To add this ability to a class you simply need to add the keyword dynamic to the class definition. So below we have very simple dynamic class.

Read More Icon Read More

Sponsors