Workingn with AMF
I want to set up a more secure process than a current ActionScript POST/GET service querying. To do that I started looking at AMF.
Action Message Format(AMF) is a binary file format representing a serialized ActionScript object. The AMF file type is used throughout the Flash Player for data storage and data exchange. For example in the Flash Player AMF is used in SharedObjects, RemoteObjects, LocalConnection, ByteArray, RTMP, and all RPC operations. Some of the benefits of AMF include:
- File Size – AMF objects are very small and are compressed using zlib.
- Fast Serialization/ Deserialization – AMF is transformed using native C code in the Flash Player making it very fast. The AMF format was designed to serialize and deserialize quickly under low memory and slower CPU conditions making it perfect for the web. AMF data is parsed directly into objects, meaning there is no lag for interpretation or parsing of AMF making the creation of objects complete in a single pass.
- Native Types and Custom classes supported – You can serialize any object in Flash Player with the only exception being a displayObject.you can also map serialized objects back to custom class instanced provided the custom class is in the Flash Player when the AMF object is deserialized.
AMF existed in ActionScript 2 and was just called AMF as of ActionScript 3 the AMF protocol has been updated and is referred to as AMF3. For historical reasons the original AMF format is now referred to as AMF0. One of the main upgrades to AMF3 is that the object is now zlib compressed for faster transfer do to the smaller file size and the additional of data types that were released with ActionScript 3.
The two alternative frameworks that I am looking at are AMFPHP and Zend_AMF.
AMFPHP + Flex 3 = Error [unable to open 'services-config.xml']
While trying to configure the AMFPHP set up with the Flex 3 framework I ran in to a problem while setting up the services-config.xml.
I’ve created the file in the root directory and specified in the Flex Compiler [Additional compiler arguments] the following string -locale en_US -services “services-config.xml”.
As soon as I clicked OK an error popped up with a message unable to open ’services-config.xml’. After trying varying things I was able to figure out that the problem was with the location of the file. Simply placing the file at the root of the directory wasn’t the right location. I needed to put the file in the same directory as the main MXML executable – after that the program worked as expected.
Gumbo effects comming soon
Gumbo: the next release of Adobe Flex SDK interface will has some interesting and useful features. The idea of developing custom controls [like buttons or menues] which slide in and out based on mouse interaction can be problematic to build. The logic of incomplete slide ins and slide outs along with the gittery screen can cause the application to look unpolished.
All of this is about to change as you can see in this video describing the new sequence functionality that will be available in the next release. Have a look at the more complex sequences.
PS: seems that the new release will be hitting the shelf sometime in the second half of 2009.
Adobe Flex online tutorials
A great collection of tutorials for anyone who is interested in learning how to work with Adobe Flex. The lessons cover everything from the basics of Flex Builder to more complicated topics like building run time shared libraries. Have a look and learn something new.
Adobe Flex Builder 3 short dump [JVM terminated. Exit code=1...]
I’ve tried reinstalling the application and even removed the old versions of JRE references. Nothing helped and just as before I had to rely to googling and looking at configuration files.
The problem lied in the small FlexBuilder.ini file located in the root installation directory. The contents of the file included the following settings:
-vmargs -Xms128m -Xmx512m -XX:MaxPermSize=256m -XX:PermSize=64m -Djava.net.preferIPv4Stack=true
I’ve modified the contents to exclude the last lines and vuala, the application went back to it’s usual state [sure I lost all my projects but its nice to have a working EDI once again].
New project: two-become-one.org
Another client, another design, another adventure.
![]()
www.two-become-one.org: Soon to be fully up and running a new wedding planner website is in the process of being created.
Acipher Beta
Here’s a very basic version of the tool that I’ve developed a while ago and now converted to an online version using Adobe Flex.
The tool helps those people who wish to write in a different language but are only familiar with a English based keyboard.This is a very basic version of the tool that simply translates character by character. I hope to improve it in the near future.
PS: The tool only translates the Russian language at the moment.
Cyrilic integration of Flex and PHP
A recent project involved integration between a PHP content management tool like Joomla and Adobe Flex 2. I wrote a PHP script that parsed a MySQL database creating an XML structure that was then picked up by a HTTPService in a Flex application.
The information in the database was stored in Cyrillic format, hence when ever I was loading the data in to the SWF compiled file the end result was a collection of garbage data. Setting the actuall HTML to Windows-1251 encoding did not help the situation.
My following approach was to locate a native functionality within the Flex architecture to mediate the situation. Unforchunately I wasn’t successful in aquiring sattisfying examples to solve the problem. For that matter it became sadly obvious that I haven’t seen any flash pages using non/english alphabet [either I haven't been checking international sites that much or Adobe Flex isn't widely used overseas] .
My third approach was to look at the actual php code that was generating the XML structure. I’ve discovered a useful function mb_convert_encoding that eventually solved my problems. Using a simple snippet of code:
mb_convert_encoding($string_to_convert,'UTF-8','Windows-1251');
I was able to convert the data from UTF-8 in to Windows-1251 which allowed me to display the desired Cyrillic characters.
Bold Objects
Click here to see what it looks like.
Their intent is to use Adobe Flex 2 technology to conquer the web world.
Here is a little background information on Adobe Flex:
Adobe® Flex™ 2 software is a rich Internet application framework based on Adobe Flash® that will enable you to productively create beautiful, scalable applications that can reach virtually anyone on any platform. It includes a powerful, Eclipse™ based development tool, an extensive visual component library, and high-performance data services enabling you to meet your applications’ most demanding needs.
