Flash/Flex

Changes in Flex 4 to Flash Builder 4

by Kev on 2 July, 2009

Flex has become Flash Builder Beta and, in the process, a number of changes have been made to the earlier version of the Text Layout Framework. The TLF is a revolutionary set of classes that enables you to include very rich text, even editable, into your Flash applications via Flash Builder (or the next version of Flash Pro). [click to continue…]

Use Facebook to Comment on this Post

Reference an MXML object from an AS Object

by Kev on 6 February, 2009

Flex/AS3 can be extremely frustrating, as well as being very powerful. I’ve spent a couple of days creating a generic class for communicating with PHP, catching the response and sending it back to the calling object. I’d got fed up with having multiple, almost identical, event catching functions all over the place.

So, having done that (not without a struggle) and having received back nicely formatted XML data ready for populating the datagrid on the main MXML page I then found I couldn’t (or didn’t know how to) assign that data to the dataProvider property of the datagrid. Flex was telling me that the object didn’t exist. This is fair enough as it makes sense given the object oriented nature of AS3 but I knew there had to be a way around it. I hit the web and found a few places where the question had been asked, only to find that the arses that responded to the question simply said “you shouldn’t do it that way” or gave a vague explanation when, in fact, a one liner would have done it. Don’t we coders have enough challenges when creating code without unhelpful “support” from our fellows?

Anyway, here it is. To reference an MXML object from any object (assuming you’ve given it an id)

Application.application.nameofobject.property/method

In my case it was:

Application.application.dgorglist.dataProvider=theXMLList;

So, in this case, Application.application takes the place of _root in AS2 applications when referring to properties.

Use Facebook to Comment on this Post

Removing Spaces from a String in ActionScript 3

January 29, 2009

Here’s a simple, two line function for removing spaces (can be adapted for any other character) from a string in AS3. I used it for removing any spaces typed into a Post Code. public function stripspaces(originalstring:String):String { var original:Array=originalstring.split(” “); return(original.join(“”)); } All we’re doing is splitting the array using the space character and then [...]

Read the full article →

Captivate Loading

November 28, 2008

If you’re a Captivate user, you’re probably aware that there are a number of Captivate variables that you can access from Flash. In other words, you load up a Captivate SWF inside a Flash movie and can then access some information about that Captivate movie including, for example, the number of slides, the current slide [...]

Read the full article →

Search and Replace in Flash/Flex

August 23, 2007

ActionScript 3 is one of the few languages I’ve ever worked with that lacks a native search and replace string function. In earlier versions of ActionScript it was necessary to hand-write a function to achieve this but AS3 can do it, just not as easily as it should. Use Facebook to Comment on this Post

Read the full article →