Switch On The Code RSS Button - Click to Subscribe
Sep
29

Dynamic Classes in Flex and Actionscript

I have known about dynamic classes in Flex and 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 »

Posted in Flex, All Tutorials | 1 Comment »

Sep
24

Adding Dynamic Rows To Flex DataGrid

One of the many things people want to do when using a DataGrid is adding new rows to the data. Now this can be done a bunch of different ways. One method is using a popup to handle adding items to the collection the grid is bound to. Another method is to add another row directly into the grid. This tutorial is going to focus on the second of the above methods.
 
Read More »

Posted in Flex, All Tutorials | 2 Comments »

Sep
11

Flex DataGrid Selected Row Styling

So in my previous tutorial I had an example on how to change a selected row’s styling. At the end of that article I said there is a better way to do this, well today I am going to show that better method. This tutorial is going to to show a good method for changing just about anything on a selected row in any list based component.

 
Read More »

Posted in Flex, All Tutorials | No Comments »

Sep
2

Accessing DataGrid ItemRenderers

In order to do a lot of crazy things with the Flex DataGrid you may need to access the item renderers. Today I am going to show a quick and easy way to get to the array of item renderers for the entire DataGrid or any list based component. Now recently I got a comment asking about how to change a certain font style of the selected row. There are a couple ways to achieve this. I am going to show how to do this using the item renderer array. This tutorial is about how to get to that entire item renderer list.

 
Read More »

Posted in Flex, All Tutorials | No Comments »

Aug
7

Simple DataGrid Item Editor in Flex

One of the more mysterious features of the Flex DataGrid is how to use item editors. Well I am going to start a few tutorials on this subject. This first tutorial is going to jump in and show how to create an easy to use item editor. Item editors can be simple or very complex - anything from a text input to a full input form. This tutorial is going to use a basic ComboBox to change a single value.

 
Read More »

Posted in Flex, All Tutorials | 1 Comment »

Jul
30

Flex DataGrid Goodies - Row Color and Others

In Flex one of the most used and useful components is the DataGrid, and it happens to be the component we get the most questions on. This tutorial’s sole purpose is to show off some of the cool things that can be done with the Flex Datagrid and to answer a few of the questions that we have outstanding. Some of the topics covered in this tutorial include changing the row color, header colors, header renderers, using dynamic xml data and others.

 
Read More »

Posted in Flex, All Tutorials | 24 Comments »

Jul
17

Simple Flex Drag and Drop

Today I am going to run through a smallish tutorial on creating and using drag and drop in Flex using the DragManager class, which is a utility provided to make drag and drop easy. I should also mention, right off the bat, that some things like lists already have various drag and drop features built in. I however will be showing a example that is useful for any custom drag jobs you might need to do.

 
Read More »

Posted in Flex, All Tutorials | 1 Comment »

Jul
2

Using a PHP Proxy with Flex to talk Cross Domain

Now one of the worst pieces of working with Flex is cross domain security, oh how I hate it sometimes. Now I understand that there is a reason that the Flash player can’t just grab information from any domain it wants all willy nilly, but sometimes this really hampers getting something built. Silverlight also has this issue, and recently I went over using Yahoo Pipes for a proxy for a Silverlight Twitter Client. Today I am going to show how to build a simple PHP script to use as a cross domain proxy.
 
Read More »

Posted in PHP, Flex, All Tutorials | 2 Comments »

Jun
12

Adobe AIR and Flex - SQLConnection

Adobe added the ability to use local databases when they created AIR. This is one of the many features that help make Adobe AIR a great solution for cross platform desktop applications. In this quick tutorial I am going to show how to create a database file and open a connection to it. The code is very simple so let’s jump right into it.

 
Read More »

Posted in Adobe AIR, Flex, All Tutorials | 3 Comments »

May
29

Flex BrowserManager - Browser History and the Back Button Fun

So, how many times have you and I read something on the web that says you shouldn’t use Flash/Flex because it breaks the back button? Well I for one say fooey to this. Today I am going to show you how to fix the back button in Flex 3 and add states to the browser history. Inside the Flex 3 framework there is a nice gem that can be used, it is a singleton (for more info check out our Singleton Tutorial) class called BrowserManager. This class allows us to change the url and receive notices when the user or browser changes the url.

 
Read More »

Posted in Flex, All Tutorials | 6 Comments »

May
1

Building Flex Degrafa Tic Tac Toe - Part 1

This is the first of a several part tutorial that is going to explain how the Tic Tac Toe application was built using Flex and Degrafa. If you haven’t checked out the introduction to the game we are going to build check out the Introduction to Tic Tac Toe using Degrafa and Flex. In this first part I am going to go over how to do some basic drawing using Degrafa and creating the game grid.
 
Read More »

Posted in Flex, All Tutorials | 1 Comment »

Apr
23

Flex Custom Cursor Tutorial

On our site here we are kinda obsessed with showing how to use your own cursors in everything - and so now its time for a tutorial on how to do the basic cursor manipulation in flex. In this tutorial you will learn how to replace the cursor with your own custom image. There are some more complex techniques that can be used for cursor management in Flex but I am going to hold these off for a later tutorial, as most people probably won’t need them.
 
Read More »

Posted in Flex, All Tutorials | 7 Comments »

Apr
14

Flex - Rotating Cube ViewStack Component

Today I am going to show and give out a cool component I have built. The component is built to make it easy to use Alex Uhlmann’s Distortion Effects in a ViewStack based component to rotate to the sides. I will show an example application and how to use the component, CubeEffect. Hopefully someone out there will find a good use for the component or at least some use of the source provided here.
 
Read More »

Posted in Flex, All Tutorials | 10 Comments »

Apr
4

Flex & Degrafa Tic Tac Toe Tutorial Series Introduction

I have started playing around with Degrafa lately and decided to make a set of tutorials about it. This post is going to give an overview of the series. The entire series will show step by step how to create the Tic Tac Toe game featured below. This will be the first series of tutorials built around creating a full application, so if there pieces that are incoherrent let us know. I hope everyone finds some useful information out of them.

 
Read More »

Posted in Flex, All Tutorials | 6 Comments »

Apr
1

Nested Data in Flex DataGrid by Extending DataGridColumn

There are several technologies that I use on a very regular basis, among these are XML and Flex - which shouldn’t come as a surprise to anyone. And anyone who has played with Flex a good deal knows that outputting nested XML or object data to a DataGrid isn’t as easy as it should be. So today I am going to show off some code to make this much easier.
 
Read More »

Posted in Flex, All Tutorials | 11 Comments »

Mar
28

Getting Started with Adobe Flex and Away3D

Here on the blog we are always looking for new technologies to play around with and I seem to have found one that I am going to be spending some time playing with, Away3D (a 3D Flash engine). Personally, I have spent a good deal of my time in the last couple of years looking at 3D, whether it be on the desktop or web, and it is exciting to finally play around with 3D in Flex. The goal of this tutorial is simple, to get you acquainted with Away3D and get a spinning cube rendered on the screen. This is going to be easier than you think.
 
Read More »

Posted in Away3D, Flex, All Tutorials | 6 Comments »

Mar
25

Best Adobe Flex Resources and Tutorial Sites

Considering that this website is based around creating easy to follow and useful tutorials, I decided to share the places I go for Flex tutorials and information. Now of course the number one place I would go to find Flex tutorials would be this site, but you already knew that.

 
Read More »

Posted in Tech News, Flex, All Tutorials | 20 Comments »

Mar
20

Flex Tutorial - Image ItemRenderer

Just the other day a commenter on our Flex tutorial about TileList Selection Indicators had a question about how to change something about the selected item. In this case it happened to be about how to change the transparency of images that are in the list. Now instead of actually handling this inside the list itself we are going to write an ItemRenderer for this, you can check out our other tutorial on ItemRenderers for more specific information on the subject. Our ItemRenderer will check to see if the data being rendered is also the selected item of the list.
 
Read More »

Posted in Flex, All Tutorials | 8 Comments »

Mar
11

Flex Tutorial - DataGrid in a DataGrid

So not to long ago we received an E-mail asking a question about Flex DataGrids. This was actually asking the best way to get to a DataGrid that is being used as a item renderer inside another DataGrid. And this brings us to the tutorial of the day. I hope that this tutorial will shed a little light onto the subject.
 
Read More »

Posted in Flex, All Tutorials | 11 Comments »

Feb
12

Flex And Yahoo Maps

Well, its been a couple of days since we had a tutorial come out of the doors here, which we apologize for, but hopefully as a big project we are working on finishes up the tutorials will start pouring out again. This tutorial is going to go over how to use the brand new Yahoo Maps API. The API is very easy to use and should be a lot of fun to make applications to mash up different services.
 
Read More »

Posted in Flex, All Tutorials | 8 Comments »

Jan
3

Flex Tutorial - Runtime Button Icons using Flash symbols

So to get the the new year started off I decided to write a quick tutorial about two items that almost any Flex programmer can take advantage of. One is how to change the icon on a button at runtime and the other is using symbols in a flash .swf file for those icons. The major advantage of using the symbols is that you can use a single flash file to hold all the icons you need for your application. And what application wants to have completely static icons on their buttons? Ok, probably most, but we will ignore the nay sayers so that we can have some fun.
 
Read More »

Posted in Flex, All Tutorials | 10 Comments »

Dec
13

Flex Snippet - Duplicating a Vector (Movieclip) Image

Problem Summary

You need to duplicate/clone a image that is loaded from a swf (a vectored image). This could be for any reason, but one situation would be for caching images.

Solution Summary

The Flex Image class will store the data representing the image in the content property. When a swf image is loaded into the Image the content, this will be a Movieclip which has a loaderInfo property which gives you access to the actual byte array behind the data that is loaded. Now to solve the problem you need to copy/load the bytes from one image into a new loader and set the source of the new image equal to the new loader.
 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 4 Comments »

Dec
11

Flex Tutorial - An Asynchronous JPEG Encoder

This weekend I needed to encode a rather large image as a jpeg using flex. And you know what I found? It was slow. And cpu hungry. While this was not entirely unexpected, it was disappointing. I could have dealt with the program being slow and unresponsive during the time it took to encode the image, except for one problem - after about 15 seconds, the flex app would run up against the script timeout error. You know, the error that goes along the lines of “A script has executed for longer than the default timeout period of 15 seconds.” And because of this, the jpeg encode never actually finished.
 
Read More »

Posted in Flex, All Tutorials | 19 Comments »

Nov
30

The Flex Drop Shadow

Shadows are all the rage right now in user interfaces - Vista and Leapard both have shadows underneath opened dialogs. They provide a really quick way to give your flat application the feeling of depth. Apparently the makers of Flex knew this, since they made adding shadows to pretty much anything very easy. By the end of this tutorial you’ll know how to add drop shadows to Flex components and how to configure their appearance.
 
Read More »

Posted in Flex, All Tutorials | 6 Comments »

Nov
20

Flex Tutorial - Change the List Selection Indicator

Recently we were using a TileList to show a group of images and we wanted to completely change how the selection indicator looked. We wrote the item renderer to handle all of the selection code and the only thing left to do was remove the selection indicator from Flex’s TileList control. To our surprise, however, Flex doesn’t expose a style or property to do this.
 
Read More »

Posted in Flex, All Tutorials | 20 Comments »

Nov
2

Sending Flex Data to PHP using XML

When using Flex you often need to transfer data to a backend server, and one option to do this is to use XML; this tutorial is going to explain the basics of sending XML data to PHP. I am going to show how to build XML data using Flex’s built in classes and then we will send the data over to PHP to be handled however you would like. The code for this tutorial is arranged slightly different than earlier tutorial, all the ActionScript code is in separate files that are included into the mxml. This technique is very similar to one used for ASP.Net pages (basically a code behind) - and helps to separate the logic code from the display.
 
Read More »

Posted in PHP, Flex, All Tutorials | 17 Comments »

Oct
23

Flex Snippet - Simple Tween Effects

After a small discussion about actionscript tweening with one the other coders here I decided to write up a small tutorial on some basic tweens. Now in the last Flex tutorial we used effects to enhance the visuals of our state transitions, but today we are going to effects for something different all together. I am going to show how to use a couple of the many available effects to animate an object around the screen.
 
Read More »

Posted in Flex, All Tutorials | 4 Comments »

Oct
16

Flex Snippet Series - State Transitions

This is going to be a quick tutorial over using transitions when changing states. It is going to build off the states basics from this tutorial. Again states are very useful in almost all applications and using transitions can put some nice eye candy on your application. This will show some cool transition effects.
 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 3 Comments »

Oct
9

Adobe AIR and Flex - Getting Started

So I decided it was time to start doing a few Adobe AIR application tutorials especially with the recent updates. This one is going to be a short tutorial on how to get your first AIR application going. The first thing we are going to do is get everything we need to start running and building air applications.
 
Read More »

Posted in Adobe AIR, Flex, All Tutorials | 6 Comments »

Sep
28

Flex Fantastic Friday - Pop Up Menus and More

I started playing around with a few different things in Flex and decided the features would make a good tutorial or at least an interesting one. The main item on the agenda today is to talk about PopUpManager and creating pop ups. In Flex you can basically create a pop up out of any Flex component that is created, so in this tutorial I am going to show how to create a pop up in Flex that will have a menu on it which will allow us to edit text attributes of selected text inside of a text area.
 
Read More »

Posted in Flex, All Tutorials | 4 Comments »

Sep
21

Flex Snippet Series - States Part One

One main feature in Flex that has many many uses is States. This tutorial is the first in a multi-part series on how to use States and what they are. States are defined as a collection of changes to a view. With the changes you can do multiple things including adding and removing child components, change component properties, and add effects. This first tutorial will give a quick rundown of changing the view by adding components depending on the state.
 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 1 Comment »

Sep
19

Flex - Using Item Renderers

One of the coolest and most useful features I use in Flex are item renderers. They allow us to customize how lists and datagrids display information. This tutorial is going to show how to use three different types of item renderers, drop-in, inline, and custom components. I actually used item renderers in an earlier tutorial on using Advanced Datagrid Topics to get song information. But this tutorial is going to go a bit more in depth on the topic.
 
Read More »

Posted in Flex, All Tutorials | 30 Comments »

Aug
30

Flex Snippet Tutorial - Bindable Meta Tag Part 3

This is the third piece in a snippet tutorial series about the Bindable meta tag. This time I am going to go through how to use custom events with your bindable objects. Part 1 of the series can be found here and part 2 can be found here, they cover the basics of the meta tag and how to use it in simple situations.

 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 3 Comments »

Aug
29

Flex Fun - Advanced DataGrid Topics

This tutorial is going to continue to build on an earlier tutorial about the DataGrid component. It is going to show how to do several things including how to use xml with a datagrid, how to use item renderers and label functions, and how to style and skin parts of the datagrid and scrollbar. Also at the end of the tutorial I supply a zip file with all the source code and assets needed to create the example in this tutorial.
 
Read More »

Posted in Flex, All Tutorials | 48 Comments »

Aug
24

Flex, PHP, JSON, MySQL - Advanced Updating

The last tutorial on Flex and PHP included some code to send data back and forth from a MySQL database. One of the comments asked a question about sending only the relevant updated data to the server and I decided it would be nice to write a tutorial on how to do this. I am going to build off of the last tutorial for this so if you haven’t looked at it I would advise it. Along with only updating the data that changes we are also going to differentiate between an update and delete.
 
Read More »

Posted in MySQL, PHP, Flex, All Tutorials | 37 Comments »

Aug
20

Communicate Between Flex and Silverlight using Javascript

If Flex can communicate with Javascript and Silverlight can communicate with Javascript, it seems like there should be some sort of transitive rule that let’s Flex communicate with Silverlight. Well there is, and this tutorial is going to show you how to use Javascript to communicate directly between a Flex application and a Silverlight application.
 
Read More »

Posted in Silverlight, Flex, Javascript, All Tutorials | 7 Comments »

Aug
14

Flex Snippet Tutorial - Using The TextRange Class

The guys over at Adobe have provided us with a lot of classes that simply make our job as developers very easy. Today I am going to go over one of this classes, TextRange. This class allows us to bind to one of several components and get/set properties about the text in that selection. The properties that can be modified include the text itself and the styles for the text. The namespace for this class is mx.controls.textClasses and the Adobe documentation page can be found here for further info.
 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 8 Comments »

Aug
13

How to use Flex to get Music Info from Amazon Web Services

So I got bored one afternoon and made a cool little application that uses Amazon Web Services to get information about music. This tutorial will show how to connect to Amazon Web Services and use the information returned from it. This tutorial uses Flex 3.0, so in order to use this code you need to be writing a Flex 3.0 application. Most of the code should be able to be used in Flex 2.0, but no guarantees. You can go grab Flex 3.0 here.
 
Read More »

Posted in Flex, All Tutorials | 38 Comments »

Aug
9

Flex Snippet Tutorial - Application Creation Life Cycle Events

There are many times when I don’t remember exactly when application startup events are fired in Flex. I figured this probably happens to other people so why not write a small post about what life cycle events are fired when? Hopefully after this short tutorial you will have a good idea of when particular life cycle events are fired.
 
Read More »

Posted in Flex, All Tutorials | 1 Comment »

Aug
6

Flex Snippet Tutorial - View Stack Component

The Flex framework has a few different components to modify the layout on the page. This small tutorial is going to go over one of those options, the ViewStack component. This component is a fairly simple component that lets the programmer have multiple ui layers on one panel, but flip between which one is visible cleanly and easily.
 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 2 Comments »

Aug
2

Using Flex, PHP, and JSON to Modify a MySQL Database

To follow-up on the Flex and PHP tutorial we did earlier I thought it would be nice to do a complete tutorial on php, mysql, flex, and json. This tutorial should show a decent way to send data in a database to and from flex to php using json.
 
Read More »

Posted in MySQL, PHP, Flex, All Tutorials | 34 Comments »

Jul
31

Flex Snippet Tutorial - Bindable Meta Tag Part 2

This short tutorial is part two in an ongoing series of tutorials about the Bindable Meta Tag in Flex. If you need a refresher check out the first part.
 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 8 Comments »

Jul
27

Flex Friday Feature - Datagrid Component

Due to popular demand, we’ve got another flex tutorial here for you all. I am going to go over a Flex component that we get a lot of search traffic for, but I have not yet gone in depth about. The datagrid component is one of the most versatile and used UIComponents in the flex environment. After this tutorial you should have a good grasp on how to use the datagrid component and what can be done with it.
 
Read More »

Posted in Flex, All Tutorials | 41 Comments »

Jul
24

Flex Snippet Tutorial - Bindable Meta Tag Part 1

o heres a quick rundown of a very cool way to bind data in Flex. The way you can do this is a very simple meta tag called Bindable. First, you probably want to know what exactly a meta tag is. Meta tags are pieces of information you use in your code to tell the compiler certain things.
 
Read More »

Posted in Snippet Tutorials, Flex, All Tutorials | 6 Comments »

Jul
19

Flex & Javascript Tutorial - Simple Interaction

Now that we have gone over Flex and PHP its time to get some client side interaction going on with Javascript. This tutorial will show you how to call javascript functions from flex and flex functions from javascript. There is a really nice example of the use of this on Google Finance, as well as a number of other google sites.
 
Read More »

Posted in Flex, Javascript, All Tutorials | 71 Comments »

Jul
8

Flex & PHP Tutorial - Transmitting data using JSON

To make sure we don’t get too stuck in a rut with our tutorial posts I decided to branch out a little bit and talk about Adobe Flex 2.0. I recently spent a lot of time figuring out how to do this. Basically what I am going to go over here is how to use php and json to send data to your flex application, and then how to use that data in Flex.
 
Read More »

Posted in PHP, Flex, All Tutorials | 40 Comments »