Archive for the ‘Example’ Category

All in One - Cairngorm Store Example (ColdFusion, AMFPHP, AMFPHP 1.9, and WebServices)

Wednesday, August 29th, 2007

I have updated the Cairngorm Store multiple backend example. Along with the updated source code I have deploy a live running example. The 4 backends it supports now is ColdFusion Remoting AMF3, AMFPHP AMF0 using the RemoteObjectAMF0 class, AMFPHP 1.9 AMF3, and ColdFusion WebServices.

See it live here!

Get the source here!

To change the backend of the Cairngorm Store example just select the backend you want from ComboBox and then click on the Refresh Data button. I had to do write some exception code to convert the returned XML data into the ArrayCollection to conform all the backend but besides that it was really easy to integrate all of them into the Services.mxml.

PS: I just installed a new license on the ColdFusion server with a new Apache web server configuration so let me know if there are any issues.

Flex/AS3 and FMS getting id3 info from mp3’s

Wednesday, August 29th, 2007

There was a question on the FlashMedia mailing list about how to get id3 info from a NetStream with AS3 code. It is actually just like AS2 with some quirks to watch out for. The first is the supported ID3 tags:

About supported versions of ID3 tags

Flash Media Server supports playback of ID3 text tags in UTF-8, UTF-16, and ISO-8859-1 formats and supports ID3 versions 1.0, 2.3, and 2.4. Only tags that contain text data are supported, such as song title, artist name, comments, and year recorded.

I had a mp3 with ID3 v2.2 tags that did not work until I put in a v1.0 ID3 tag.

The next is the NetStream is not dynamic in AS3 and you use the client property to handle method calls from the server. There will be a onPlayerStatus and onId3 method call the server makes on the NetStream object.

Here is the running example and source code is available through the right click.

Flex 2 Namespacing Methods and Properties Example

Wednesday, August 29th, 2007

I came across the Namespace class while looking up some information about ActionScript 3.0’s E4X and XML. I didn’t know, will lets say, I didn’t make the connection between the Namespace class and using it with methods and properties of components. This example is very basic and is not meant to be a good use of namespaces. It shows how to use it for methods and properties.

In the example there is one method name and one property name to change a button from being rounded or square looking and being filled with red or blue colors.

Live Example Here

You can right click on the swf to view the source.

Cairngorm Store Example Updated to Cairngorm 2.1

Wednesday, August 29th, 2007

I went ahead and updated the Cairngorm Store example to Cairngorm 2.1. You can find the original example code download on http://www.cairngormdocs.org/.

Get the updated code here.

Here is my short list of changes:

  1. Changed com.adobe.cairngorm.business.Responder to mx.rpc.IResponder
  2. Changed com.adobe.cairngorm.commands.Command to com.adobe.cairngorm.commands.ICommand
  3. Changed com.adobe.cairngorm.vo.ValueObject to com.adobe.cairngorm.vo.IValueObject
  4. Deleted result and fault handlers on RemoteObjects components in the Services.mxml file.
  5. Used Call.addResponder( responder ) instead of resultHandler and faultHandler
  6. Changed onResult/onFault to result/fault
  7. Changed getService to getRemoteObject

Along with this update I have been updating the RemoteObjectAMF0 and got it working with the Cairngorm Store example. I’ll package the changes and PHP example up as a separate download, get more details in a future post.

Keynote Apollo Examples

Wednesday, August 29th, 2007

I have been interested in the Apollo project since was announced. Today at the keynote session I saw for the first time what they mean when they SWF, HTML, DHTML and PDF will worknciely togather. One example they showed demonstrated drag and drop events between Flex and Google maps (DHTML) mini-app all wrapped in Apollo. Apollo is bigger and quite different then my original opinion of comparing it with Zinc by mdm.

Flex 2 and Red 5 Chat Live Example

Wednesday, August 29th, 2007

I did not put a working example of the Basic Chat example using Flex 2 and Red 5 up on my server early. I needed to install Red 5 to be able to put it up. I wasn’t sure when I was going to be able to get to it so I posted the code first. I had some free time this morning and decided to give the Red 5 server install a try. It was not terrible bad, and I’ll try and write up my install experience later. But for now the working online basic chat example can be found at:

http://renaun.com/flex2/red5/BasicChat.html

You can view the source by right clicking on the application.

I had some issues with the Red 5 server running even when I logged off the server. I think i have it worked out with a nohup for now. I will need to figure out how to install red5 with a proper start and stop script. If any one knows send me an email…

I have made some minor updates to the live examples, default button and auto scroll position.