Articles about Flex’

Aug 21, 2009

getDefinitionByName, ReferenceError and the Frame metadata tag

Posted by Dennis in ActionScript, Flex 2 comments

The hard-working, unstoppable Meister Wanja came to me with the following problem involving getDefinitionByName and interfaces. Say you have the following class:

package {
import flash.display.Sprite;
import flash.utils.getDefinitionByName;

public class Blah extends Sprite
{
public function Blah()
{
var ref : String = “YourMama”;
var ClassRef : Class = getDefinitionByName( ref ) as Class;

var booh : IMama = new ClassRef();
}
}
}

Build it, run it and [...]


Mar 9, 2009

Optimising the data loading process with Flex, AIR & Ant: compiled SWF files instead of verbose XML files

Posted by Dennis in ActionScript, Flex 6 comments

The project I’m currently working on needs to load large amounts of data. The application uses data which is supplied to us in the form of Excel sheets. The data for one object consists of 4500 records.
XML files are typically used for this kind of task. However in this case the XML files are huge. [...]


Feb 19, 2009

Easy deep clone method made easier

Posted by Dennis in ActionScript, Flash, Flex 7 comments

In a previous post I talked about an easy deep cloning method I found and which I tweaked a little.
While I was crammed in the tube yesterday (sometimes the best ideas are born in the underground) I came up with an idea to simplify and generalise this even further. The problem with the current method [...]


Feb 5, 2009

Debug Flash/Flex & Air with De MonsterDebugger

Posted by Dennis in ActionScript, Flash, Flex 5 comments

I highly recommend this debugger. It is an AIR application that has many useful features and will make your life much easier. Some of those features are:

detailed traces (trace strings and objects, which you can expand)
edit properties at runtime
method testing
a tree structure with which you can walk through the application

On top of that, it is [...]


Feb 3, 2009

OutOfMemory error:PermGen Space with Eclipse/Flex Builder Plugin/Ant

Posted by Dennis in Flex 5 comments

This gave me a headache! This error occurred when I was trying to compile 38 separate ActionScript classes into SWF files:
OutOfMemory error:PermGen Space
If you search for this error you’ll find many blogposts written by utterly frustrated Java developers. It appears to be a dreaded error that is raised when deploying war files to web or [...]


Oct 23, 2008

Headless-server setting in flex-config.xml fixes error on automated build

Posted by Dennis in Flex 2 comments

I came across this error during an automated build on the server:

Error: An error occurred because there is no graphics environment available. Please set the headless-server setting in the Flex configuration file to true.

This happens when the server isn’t hooked up to a monitor, mouse, keyboard, etc. The flex-config.xml file needs to be updated [...]


Oct 21, 2008

Getting rid of a button’s border/linkbutton’s background roll over state in Flex

Posted by Dennis in Flex 11 comments

Some Flex components have visual elements that cannot be controlled with CSS. Have you ever tried removing the border of a Button or the roll over background color of a LinkButton? I had this problem a few times before and the solution to this is very simple. Just reset the skin

.myButtonStyle
{
skin: ClassReference(”mx.skins.ProgrammaticSkin”);
}


Sep 8, 2008

Flash Player 10 & Flex Builder: Class flash.geom::PerspectiveProjection could not be found.

Posted by Dennis in 3D, ActionScript, Flex No comments

I got this runtime error when trying out the new 3D features in the latest Flex SDK:
VerifyError: Error #1014: Class flash.geom::PerspectiveProjection could not be found.
This can be fixed this by setting the Flash Player version to 10.0.0 (or whatever fp10 version you’re using) in Properties > ActionScript Compiler > HTML Wrapper > Require Flash Player [...]


Aug 13, 2008

Newline characters not recognized when parsing external XML file

Posted by Dennis in ActionScript, Flash, Flex 2 comments

I encountered this problem when implementing a workaround for the multiline unicode text wrapping bug. I use newline characters (”\n”) to break up the text manually. When I load the XML file and parse it in my Flex app, newline characters are displayed in the text field. Tracing out the string displays “\n” and not [...]


Aug 13, 2008

Flashplayer bug: Incorrect wrapping on multiline Unicode text

Posted by Dennis in Flash, Flex 4 comments

I came across this bug while working on a localised Flex application for one of our clients. In the Thai version of the site the text was wrapping incorrectly. It didn’t cut off sentences where there were whitespaces. Instead it cut off in the middle of words. Take a look at this example:

You can see [...]