Archive

Archive for September, 2011

Combobox, fontFamily

September 23, 2011 Leave a comment

Here’s a quick sample of code to show each item in a combobox with different fontFamily, use full when you build a text editor :

In ActionScript you fill the dataProvider of you comboBox :

fontFamilyCombo.dataProvider = new ArrayCollection( ["Arial", "Courrier", "Courrier New", "Geneva", "Georgia", "Helvetica", "Times New Roman", "Times", "Verdana"] );

Then in MXML :

<mx:ComboBox id="fontFamilyCombo" ">
     <mx:itemRenderer>
          <fx:Component>
               <mx:Label fontFamily="{data}" toolTip="{data}" />
          </fx:Component>
     </mx:itemRenderer>
</mx:ComboBox>

AMFPHP 2 / Mapping / RemoteClass

September 16, 2011 Leave a comment

I am working since a couple of months with the last version of AMFPHP, the version 2.0RC1. So far, worked quite fine, and I was satisfied eventhough the new team decided to not keep the service browser (which was so usefull).

This week I worked on a large application PHP / FLEX using AMFPHP. So I try to use mapping and have my classes mapped automatically (RemoteClass, explicitType, …). Before I had no problem with AMFPHP 1.9, but with the new version it was just hell.

At first everything seemed to work fine, the objects were mapped automatically, but quickly after checking the value of the parameters of each object, I realised for some reason I still can’t explain, some parameters had wrong values.
I spent quite a while exploring my code, searching on internet and so far no explanation at all.

I finally replaced the AMPHP version 2 with the previous one 1.9, and it worked just perfectly. My object were mapped perfectly (I checked every parameter of every object).

So I guess there is a bug on mapping with the last version of AMFPHP.