Fileupload using Zend AMF, RemoteObject and Flash 10

19 04 2009

In one of my earlier posts i described a method for uploading files using the RemoteObject class found in the Flex SDK. For the “back end” i used the still very popular amfphp implementation of the AMF protocol.

Wade Arnold the maintainer of amfphp is also involved in another implementation of the AMF protocol which is shipped with the Zend Framework. After reading some blog posts about this “new” package called Zend_Amf, i decided to give it a try.

Download for full example code.
Read the rest of this entry »


Fileupload using AMFPHP, RemoteObject and Flash 10

15 03 2009

File upload with Adobe Flex is a common asked feature for lots of applications. There are several posts on the internet to be found which explain, in detail, how to do this.

Most of these examples however uses the http protocol to transport the binary data. With the arrival of the Adobe Flash 10 player and the new FileReference features that comes with it, it is now also possible to upload a file via a RemoteObject service call.

Read the rest of this entry »

Localized flex login using the Swiz framework

7 03 2009

After reading some blogs about a relative new Flex framework called swiz, i decided to try it out some time. Swiz is a framework. started by Chris Scott, that aims to bring complete simplicity to RIA development.

To get some feeling with the framework i started to work out a login example i found on the blog from Sönke Rohde, which uses a utility for mocking service calls, which also can be found in the swiz framework. For my own example i used the following snapshot swiz-0.0.5-010609.swc with mediator and event type checking support, but decided to extend the login sample with some runtime localization features.

These localization features consist of some xml-files which can be loaded during runtime and are used for translating labels and fault messages (bad credentials).

During development of the new example i found out that the mockutility in the framework only returned a result. In a real-life application faults will occur so i copied the sources of the swiz framework TestUtil class into a new class called MockUtil and added my own mockFault and mockFaultEvent methods.

The sources of my extended login example can be downloaded here (swiz library not included!). The assets/data/users.xml file contains the mock data for the login and can be modified with your own user credentials. The assets/locale directory contains sub-directories with the localization files used.

The Paradox of Our Age

29 12 2008

Almost 2009! So here is something to think about.

The Paradox of Our Age

“We have bigger house, but smaller families;
more convenience, but less time.
We have more degrees, but less sense;
more knowledge, but less judgement;
more experts, but more problems;
more medicines, but less healthiness.
We have been all the way to the moon and back,
but have trouble crossing the street to meet the
new neighbour.
We build more computers to hold more
information to produce more copies than ever,
but have less communication.
We have become long on quantity,
but short on quality.
These are times of fast foods,
but slow digestion;
tall man, but short character;
steep profits, but shallow relationships.
It’s a time when there is much in window,
but nothing in the room.”

His Holiness The XIVth Dalai Lama

RemoteObject using AMFPHP and Actionscript 3

6 09 2008

In my daytime job i am currently involved with a Flex3/BlazeDS project.The question arises to me quickly if it was possible to use Actionscript 3 RemoteObject classes with a PHP back end. A quick search with Google showed me some examples where Flex mxml in combination with amfphp 1.9 was used. This particular version of amfphp has support for AMF3 messaging protocol and therefore can be used natively with AS3 RemoteObject.

In my example i wanted to do something different by using AS3 RemoteObject classes and creating Channels at runtime, so no server-config.xml is needed during compile time.

Read the rest of this entry »

Badge installing AIR application with SWFObject

29 02 2008

Adobe finally released it’s 1.0 version of AIR, so let’s go to work and create great looking applications. But how on earth do we deploy these applications to the public?

When downloading the AIR SDK a sample is provided for installing and deploying air applications using the badge installer. This badge installer consist of a badge.swf file and some javascript which can be used within html and automatically installs the right version of the Adobe AIR runtime followed by your application.

When using flash within (x)html i personally prefer to use the SWFObject javascript file so here are the steps involved of deploying AIR applications using the badge installer and SWFObject.

First of all you need to change your webserver configuration to add support for the AIR mime type by adding the following line to your, for example, Apache configuration file:

AddType application/vnd.adobe.air-application-installer-package+zip air

Now it is time to use SWFObject. Simply include the swfobject.js Javascript file in the head section of your html, then use a small amount of Javascript on your page to embed your Flash movie. In our case this will be the badge.swf file from the AIR SDK. A complete example with the necessary variables for installing the AIR 1.0 runtime and an example “hello world” AIR application is shown below.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<title>Deploy Hello World</title>
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">
This will hold the flash content
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("your/path/to/badge.swf", "badge", "217", "180", "9.0.115", "#FFFFFF");
so.addVariable( "appname", "Hello World" );
so.addVariable( "appurl", "http://your-host/HelloWorld.air" );
so.addVariable( "imageurl", "test.jpg" );
so.addVariable( "airversion", "1.0" );
// ]]>

On the blog train

10 06 2007

Never thought that this would happen, but i have just started a weblog.

Hopefully it will last for a long time, but hey nobody knows where this blog train will lead us.