March 18, 2009

Unable to Catch IOErrorEvent’s when Loading a ByteArray into an Image

Filed under: ActionScript, Bug Fixes, Flex — Anthony @ 1:07 pm

I was trying to load a byteArray into an image control today and would randomly get an Unhandled IOErrorEvent message. Now this shouldn't really happen as the image control uses a default broken image icon to display when there are any loading problems. Well after trying to catch the error unsuccessfully I wanted to know what was going on.
So i went digging and i found in the base class of image, SWFLoader line 1497 the following (more...)

March 12, 2009

Flex Cookbook Recipe 5.8 Allow Certain items in a list to be selectable, Doesn’t quite work correctly

Filed under: ActionScript, Bug Fixes, Flex — Anthony @ 11:38 am

Ok I needed to disable Heading elements inside a List Component in Flex, and i was being too lazy to work it out for myself so i picked up the Flex cookbook Adobe had been kind enough to send me and yes... It was there. Now the Mouse removal was straight forward and worked like a charm. But the keyboard events were a different story. The code didn't work for several reasons.
1. Key directions were not being assigned.
2. When a disabled item was at either the top or the bottom of the list it would stop you being able to continue down / up the list.
To fix this i added the following code. (more...)

March 5, 2009

Salesforce ActionScript Fun

Filed under: ActionScript, Bug Fixes, Flex — Anthony @ 4:41 pm

Ok I have been working with the salesforce API for a couple of days now and I have found it very interesting. However I have found a few things that don't seem to be very clear when trying to simply login to your account from an application that is running outside of the salesforce Sandbox.
So as i have seen a lot of posts about this i have decided to explain how i go about logging in here.

1. To login you need 3 things
1. Username in the form user@user.com
2. Password.
3. Security Token
To get the security token for a user go to setup>Reset your security token. This will then be emailed to you.

Logging into an Administrators account seems to be different than logging into a normal users account.
For Administrators you have to set the protocol to 'http' for normal users set it to 'https' in addition we have to add the token to the password as follows.

 
private var _conn : Connection = new Connection( );
 
private function login( username : String, password : String,
           token : String, isAdmin : Boolean = false ) : void
{
    _connection.protocol = isAdmin ? 'http' : 'https';
    var login : LoginRequest = new LoginRequest( );
	  login.username = value..username;
	  login.password = value..password.toString( )
                                    + value..token.toString( );
	  login.callback = new Responder( loginResult, loginFault );
	 _connection.login( login );
}
 
June 24, 2008

Application Version Control in AS3

Filed under: ActionScript, Bug Fixes, Flex, Japanese — Anthony @ 2:23 am

I thought that I would just write a quick note on how I know which version of an application I am looking at when it has been published to the web. It's all well and good saying its revision 87 from svn but how do you know? Well a simple way is to add it to the Flashplayers custom context menu. Right click to see the custom menu and to view the source (more...)

June 19, 2008

*.CSS files are Whitespaces Sensitive

Filed under: Bug Fixes — Anthony @ 2:28 pm

Just a quick note to say that if your stylesheets don't seem to be applied correctly
Styles in a .css file are white space sensitive so if you place text-align: left it works but if you place text-align : left it breaks the css as it thinks that the tags name is text-align : ( inclusive of the final space between the last letter and the : ) !!

Profiler Problems in Flex!

Filed under: Bug Fixes, Flex, Physics, Profiler — Anthony @ 12:44 am

After reading an example chapter from Training from the Source : Profiling Flex Applications on InsideRIA I thought ooo! I like using the profiler but i didnt know you could do that! So away I went and opend up one of my apps and clicked Profile.... O no whats going on? No Profiler prompt just straight into the application

Socket closed.
Socket closed.
Socket closed.
Flex Profiler No activity 60 seconds after connection.

and then quiet (more...)