Archive

Archive for October, 2008

Zend Amf for President ’08

October 31st, 2008

Zend Framework is finally running for higher office!

Flash Platform, Zend_Amf

Lee Brimelow created a Zend Amf tutorial

October 30th, 2008

Most of my examples have been produced in Flex and assume that you understand that Zend Framework. Lee produced a new tutorial that starts from scratch that and uses a netconnection out of Flash for the rather than RemoteObject from Flex. If your just learning Zend Amf go check out this video.

New video tutorial on using ZendAMF

Lee is not using comments.. ;-)
Doc Bloc is your friend! LOL

Flash Platform, Zend_Amf

Missed the Flex and Zend e-Seminar? No Problem.

October 29th, 2008

Did you miss last week’s Flex and Zend e-Seminar? That’s not a problem – we recorded the session using Acrobat Connect and have posted it online.

If you have questions about using Flex and the Zend Framework and want them answered in person, there will be another session about using Flex and the Zend AMF module in the Zend Framework on November 12th at 10 AM PT. Lee Brimelow and Zend AMF contributor Wade Arnold will be delivering the session.

Repost from Flex Team Blog

Flash Platform, Zend_Amf

Type Mapping in AS3 : WRAP IT UP!

October 28th, 2008

Type Cast objects coming back in AMF are mx.utils::ObjectProxy and are capable of becoming the object type that you specified. However we don’t want to JUST ASSume that you are getting the correct object type back. It takes a small amount of work. In order to change the ObjectProxy into the proper data type.I recommend that you wrap your result into a try catch before you just assume that you have received the correct data.

private function onResult(event:ResultEvent):void{
  try {
    var myContact:ContactVO = event.result as ContactVO;
    trace('name' +myContact.firstname);
  }
  catch(error: Error) {
    trace('onResult error: ' + error.message);
  }
}

Yes you could just Jam the type into a value.

var myContact:ContactVo = ContactVO(event.result);

But if something didn’t work out on the server and you get a successful result your application just crashed because you have a type correlation exception.

or as Ivan Erickson Suggested:

private function onResult(event:ResultEvent):void{
  try {
    var myContact:ContactVo = ContactVO(event.result);
    trace('name' +myContact.firstname);
  }
  catch(error: Error) {
    trace('onResult error: ' + error.message);
  }
}

if you’re not going to null check the return from var and save the CPU cycle for the as().. thanks Ivan!

Joel Caspers a new T8DESIGN stud also says:
Also, you can remove the need for try-catch statement entirely by using the is operator in an if statement – in my experience try catch statements are processor costly and I’ve always been instructed to stay away from them, as well as you could be catching an error that you are not intending to catch (something other than the cast error inside your try statement).

If (event.result is ContactVO) {
   //it is what you think it is
   Var myContact:ContactVO = ContactVO(event.result);
} else {
  //the result is not what you think it is so spit out the type in the console
   Trace(getQualifiedClassName(event.result));
}

Hope that this helps!

AMFPHP, Flash Platform, Zend_Amf

Bug Fix: Returning nested arrays in Zend_AMF produces Client.Data.UnderFlow errors

October 27th, 2008

Zend Amf has been updated to reflect a bug found by Patrick Gutlich.  To get this patch, you have to checkout the latest version of Zend_Amf from standard/trunk in SVN. Thanks Patrick for your help!

Zend_Amf

bug report ZF-4712

Flash Platform, Zend_Amf

Zend Amf Questions, Features, Demos, Bugs?

October 24th, 2008

Zend Amf is about to become finalized for the 1.7 release. This makes for a good time to figure out what people want to see next. Please post your feedback here if you have been using Zend Amf and need an additional feature to have it meet your needs. Some of the things that I wanted added are:

  • Service Browser
  • Authentication
  • AMFext

Flash Platform, Zend_Amf

iLog component survey

October 22nd, 2008

Take this survey about the ilog components and you could win $500 bones.  What’s more important is that the 2.0 release looks pretty cool. There is a 3 minute video in the survey that shows all the new stuff.

Flash Platform

Mixed Array’s in Zend Amf are not generic objects

October 22nd, 2008

The reason that AMFPHP just returned generic objects rather than mixed array is because it was primarly based off of AS2 which did not have mixed arrays only generic objects. Now that we have AS3 and actually able to re-write the parser we are going to return mixed arrays when that is the real data type for Amf3. This is not a bug it’s more that the bug was actually fixed.

So if you really want to return a generic array when you have a mixed array in php you can just cast the return and it will work like AMFPHP did.

public function returnData()
{
  $data = array(“one”, “two” => “three”);
  return (object) $data
}

AMFPHP, Flash Platform, Zend_Amf

Zend Amf NetConnection bug resolved w/ Amf3

October 22nd, 2008

If you are testing out Zend Amf and were getting call bad version errors w/ complex amf3 data types check out the latest Zend Framework 1.7 preview release. You really just need to update Zend_Amf_Server in order to get the patch.

Here is the bug tracker if your still having issues.

amf3 typed objects sent to server via NetConnection fail

Flash Platform, Zend_Amf

Amfphp.net updated

October 20th, 2008

I was able to restore the amphp.org website to it’s repviouse state. We are working on getting a new wiki based website launched wich should allow for better collaberation about the topic.

AMFPHP, Flash Platform