SubClosure

{ Don't Repeat Yourself ! }

Got this nice bug coming right out of the Zend frameworks 1.9 AMF Routines.

“Unable to parse null body data flex.messaging.io.ArrayCollection mapped class  is not defined”
in file: library/Zend/Amf/Request.php:174

Was trying to send an object that has an Arraycollection as one of its parameters to the gateway.
Found this Bug Report http://framework.zend.com/issues/browse/ZF-6601
It is supposed to be fixed in 1.8.2 ?! Why is it happening in 1.9 then?

Instead of modifying the zend framework I decided to convert the object I wanted to send into an object without arraycollections.
But definitely not a proper solution. Hopefully that bug will be fixed soon. Otherwise maybe AMFPHP is a better choice then Zend AMF.

I recently ran into problems when trying to set the currenState property on a component that was part of a TabNavigator.

I had the component as a direct child in the TabNavigator.
Setting the currentState property in the component resulted in Null pointer exceptions in the Flex Framework – RemoveChild Class.

I got around it by first adding a canvas to my TabNavigator and then adding my component inside the canvas. This fixed the problem.

It is because of flex’s deferred instantiation. Flex called the creationComplete handler on my custom component even though its components were not added yet.
Thats why the RemoveChild tag in my states failed.

By first embedding the component into a canvas and then into the TabNavigator, it only created the canvas but not any parts of my component.

So you got yourself a new Macbook or an iPhone and someone swiped it? Good news – if you were lucky and installed something like Undercover you will most likely be able to track down the thieves and recover your lovely little machine.

How does it work?
Undercover installs itself into the bios of the Apple device and with the installation you get a unique device ID, that you need to provide when reporting a theft.
When the machine goes online Undercover constantly checks if the device ID is reported as stolen or not. If it is reported as stolen the device will send geographical information about its location to Undercover. It will also transmit screen shots and if possible photos of the thief. Undercover will then contact local law enforcement to recover the stolen device.

If law enforcement fails to recover it, Undercover slowly renders the device useless and counts on the fact that the thief will then either sell the device or send it in for repair. Because of geographical awareness, Undercover then display a message to the repair center or new buyer, that this is a stolen machine that needs to be returned.

Undercover can not be disabled by the thief. If you install Apple’s firmware password, your Mac can not be formatted without knowing your firmware password.

This seems to be an awesome protection from thieves and it comes at a very reasonable price.

A list of the best libraries for Flex and Flash that can save heaps of development time and add extra functionality to your projects.

  • casalib Lots of useful utility classes.
  • as3corelib A collection of utility classes by Adobe for handling encoding and serialization among other things.
  • Mate Framework – my favorite MVC  framework for Flex – it’s based on property injection
  • PureMVC – another great MVC framework, works with flash as well and has ports to many other languages
  • Cairngorm – popular MVC framework for Flex that’s officially supported by Adobe
  • FlexUnit – unit testing framework for flex – essential for test infected developers and professional projects
  • AS3Crypto – add cryptography to your Flash/Flex Applications
  • AlivePDF – lets you create PDF files from within flash and flex
  • Degrafa – Flex Graphics Framework to easily create graphic with mxml tags – awesome
  • TweenLite The easiest to use Tween library out there.
  • Papervision probably the most used 3D library
  • Away3D Another 3D library that some people prefer to Papervision as it is easier to use.
  • Modest Maps – great mapping library for using different map providers – also supports openstreemaps
  • SWFObject very useful to embed flash movies into html pages
  • SWFAddress Takes swfobject one step further and supports deep-linking.
  • Hi-ReS! Stats a class that shows you when your SWF framerate chokes.
  • BIT-101 MinimalComps A set of ActionScript-only UI components for use in non-Flex projects.
  • Underware – not a library but a nice tool that lets you package and download sets of popular libraries
  • Deface – Face detection for AS3
  • FLARManager – tool for augmented reality
  • Discollision – advanced collision detection library fro AS3
  • Flash Camouflage - easily skin Flash Applications with png, jpg, or gif images
  • MojoColors – easy color library for AS3
  • Flint Particle System - the name says it all – create particles in AS3

If you use ant to build and deploy your application,
the scp task comes in quite handy to automatically upload you project to the production server.

In your ant build.xml file you can add a line like this to your target

<scp file=”${zipfile}” todir=”${server.username}:${server.password}@${server.name}:” trust=”true” />

Where ${zipfile}, ${server.username}, etc are properties that where earlier declared
e.g. <property name=”server.name” value=”192.168.0.1″ />

The ant scp task depends on an external library that can be found here.
You need to download the jsch-0.1.42.jar and copy it into your eclipse ant library folder

e.g. /Applications/Adobe\ Flex\ Builder\ 3/plugins/org.apache.ant_1.7.0.v200706080842/lib/

(on mac I had to copy this file to ~/.ant/lib to work )

Important! You need to restart Flex Builder after that.

After that you can run your ant target and the zip file will be uploaded to your server through scp

After fixing the problem with php 5.3 and the openid library I ran into the next problem.

Trying to to use the provided example that comes with the openid php library,
with google openid url -  https://www.google.com/accounts/o8/id

And getting:

Fatal error: current_url must be a string; see NEWS file for upgrading notes. in /var/www/clients/php-openid-1.2.3/Auth/OpenID/Consumer.php

Wow – must be my lucky day today. Getting really really tired of the openid stuff. Especially cause I can’t find any decent documentation.

I figured out that I needed to add the url of the finish_auth.php to the complete function call in the finish_auth.php script itself.

//get full url of current script
$thispage = "http://".$_SERVER['HTTP_HOST'].$_SERVER[PHP_SELF];
//pass url into complete handler
$response = $consumer->complete($thispage);  //modified function call in finish_auth.php

And I had to get rid of the $_GET parameter that was passed into the complete function in the example.
This seems to solve the problem. Getting a nice response:
You have successfully verified https://www.google.com/accounts…as your identity.
Except for a few warnings and notices of course :-)

I used this url as my google identity url:

https://www.google.com/accounts/o8/id?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.return_to=http%3A%2F%2Fwww.example.com%2Fcheckauth&openid.realm=http%3A%2F%2Fwww.example.com%2F&openid.assoc_handle=ABSmpf6DNMw&openid.mode=checkid_setup

taken from this tutorial: http://code.google.com/apis/accounts/docs/OpenID.html

but had to replace

https://www.google.com/accounts/o8/ud

with
https://www.google.com/accounts/o8/id

download modified finish_auth.php

If a PHP script has an error but the displayed page stays blank and does not show anything,
add these two lines to the top of your script to display all PHP errors for the current script.

error_reporting(E_ALL);
ini_set("display_errors", 1);

I recently downloaded the latest Openid library for PHP and got the follwoing deprecated errors when trying to run the example in my webbrowser:

Deprecated: Assigning the return value of new by reference is deprecated in /php-openid-1.2.3/Auth/OpenID/Consumer.php on line 266

Deprecated: Assigning the return value of new by reference is deprecated in /php-openid-1.2.3/Auth/OpenID/Consumer.php on line 298

It seems to be only an issue with PHP 5.3 and I found a great fix at Miguel Santirso Blog.
He has gone through quite some trouble to fix all the compatibility issues with PHP 5.3 and and was so kind to provide his fixed version for download.

Flashplayer is using a separate cache to store remote shared libraries ( RSL ) .
It wont be cleared by just emptying the browser cache.

To clear the flashplayer cache go to:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html

Uncheck the checkbox: “Store common Flash components to reduce download times”

This will delete the Flashplayer Cache.

After that check it again and done

Get Adobe Flash player