AS3
February 2nd, 2011 | AS3, Flex | Matt Bryson
If you get the error “Could not resolve <s:states> to a component implementation.” on a Flex component, it might be that you are extending a Spark/Mx component and the compiler loses the scope / namespace of the states.
A simple fix is to use the namespace of your sub component instead of the spark / mx namespace. eg…
<?xml version="1.0" encoding="utf-8"?>
<view:MyComponent xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:view="com.domain.job.view.components.*"
<view:states>
<s:State name="LOGIN" />
<s:State name="WELCOME" />
</view:states>
</view:MyComponent>
m.
October 8th, 2010 | Air, AS3, Flex, memory management | Matt Bryson
Memory management and garbage collection in Flash Player is a well debated topic. Some think that the Flash player’s garbage collections is, well, useless. Others think that most flash developers simply don’t understand it and their poor code causes memory leaks.
I’m not here to get into all that, its probably a bit of both anyway, but needless to say it will cause even the best Flash / Flex developer a headache or two at some point!
There are some good resources on Flash player garbage collection -How the GC works and How to kick start the GC in Air, so read up on those first if you haven’t already.
Below are our recent experiences with an Air application that did not release memory when a window was closed.
Read the rest of this entry »
September 2nd, 2010 | Air, AS3, Flex, Geekery, Tech | Matt Bryson
Update : Thanks to Paul Robertson for pointing out that as of AIR 2.0.2 released a couple of weeks back, there is native cross platform GZIP support in Air. However, if you need to achieve this in the 1.5 runtime for any reason, the below is still applicable!
To reduce bandwidth many servers compress HTTP responses using GZIP encoding. Pretty much all web browsers support GZIP decoding, so the actual data transfered is a fraction of the final unpacked response. Flex/Flash apps running in a web browser can take advantage of this as the browser handles the HTTP responses.
However, Flex AIR apps which do not run in a browser don’t have this luxury. By default, the headers sent in a request from AIR do not accept GZIP encoding, and even if they did, Flex / AIR runtime has no idea how to handle GZIP de-compression!!
Thanks to the Flex community however, it is possible!
Read the rest of this entry »
Tags: Air, AS3, Flex, Gzip, HTTPService, URLLoader
August 6th, 2010 | Air, AS3, Flex, Releases, Tech | Tim Heyes
Skinkers release cross platform dashboard built in Adobe AIR to help patients choose the appropriate care based on real-time and location-based data.
Today Skinkers announce the launch of the UK’s first digital Urgent Care Desktop Dashboard.
Created by virtue of a joint innovation venture between Skinkers, NHS Choices, Directgov and Businesslink, United Lincolnshire Hospitals NHS Trust and NHS Lincolnshire, the tool is aimed at making the choice of which NHS service to use a little easier.
United Lincolnshire Hospitals NHS Trust patients can now download the cross-platform desktop app for free from the UHLT web site (http://www.ulh.nhs.uk/for_patients/urgent_care_tools.asp) and use it to access information about getting the right treatment in the Lincolnshire area.
Read the rest of this entry »
Tags: Air, AS3, Flash, Flex, Google Maps, Lincolnshire, NHS, NHS Choices
July 26th, 2010 | Air, AS3, Flex | Adam Maloney
Last week I discovered a rather annoying bug with Flex’s implementation of CSS.
When you create a class selector, either the compiler or the VM seems to completely ignore it. Not really really a show stopper, but when you handling multiple components with stylesheets it can be a bit frustrating when they aren’t behaving properly.
These for example:
Component1.header {
color: #ff00ff;
}
Component2.header {
color: #333333;
}
Flex completely ignores ‘Component’ part and just uses ‘header’, so will overwrite and use last one defined for all components using styleName=”header”
Even across separate MXML files and global CSS files the last one specified will overwrite previous ones.
One way to avoid any conflicts is ditching class selectors and stick with using unique names.
Component1-header {
color: #ff00ff;
}
Component2-header {
color: #333333;
}
June 15th, 2010 | AS3, Flex, PHP | Matt Bryson
We got stuck on a strange issue recently when trying to upload a file to a server using the Flex FileReference class. The file data was sent to a PHP script that processed the file, and then returned some information about the file as a response. What we found was that it worked fine on a PC, but on a MAC when Flex received the response in the uploadCompleteData handler the returned data was empty! Turns out extra white space after the php tags in a php include caused the issue.
Read the rest of this entry »
June 11th, 2010 | AS3, Flex | Matt Bryson
A small issue that might cause you headaches in flex – setting a property where the setter will only run once. It’s usually caused by flex being clever, but you can easily work around it.
Read the rest of this entry »
March 21st, 2010 | AS3, Flex | David Spanton
This is the second part of a series on using Pixel Bender to create effects in Flex. In this part I’ll go through making a simple filter in Pixel Bender that can be used to animate an effect in a similar way to the last post.
You can get hold of a copy of the Pixel Bender toolkit here and also get hold of a lot of good reading material to get started using it.
Read the rest of this entry »
Tags: effects, filter, Pixel Bender
March 8th, 2010 | AS3, Flex | Matt Bryson
This is the second in a 3 parter about the flex singleton register. This post will look at how to register your own classes with the Singleton register so you can actually use your custom implementations instead of the Flex default implementations.
Read the rest of this entry »
Tags: Custom Implementations, Singleton
March 1st, 2010 | Air, AS3, Flex | Matt Bryson
This is the first in a 3 part post about using the Flex Singleton register. This post will deal with what the Flex Singleton register is as well as how and why its used. The second will look at how to register your own classes with the Singleton register (not as easy as it sounds) and the third will be a real life example.
The final post will show you how to give the Alert control the ability to create a modal overlay that supports a custom chrome in Adobe Air. The big pain with a custom chrome (say a splat shape) is that the modal overlay covers the entire bounds of the window – including any transparent areas. So for irregular shapes/chrome – like a splat as a background, you get a big square slapped over the top – not ideal. What you want is ONLY the splat to be overlaid with the modal background.
By using the Singleton register and a custom implementation of the PopupManager we can add this functionality without having to create a custom Alert class. You don’t have to change any of your existing app code where Alerts are used, all existing calls to Alert will now have our new and improved modal background!
Read the rest of this entry »
Tags: Custom Implementations, Custom PopupManager, PopupManager, Singleton