1 Reply Latest reply on Oct 25, 2006 3:10 PM by Nataliefay

    item Renderer in ActionScript

    therf
      I typed the devguide example on pp 719-720 into 2 separate files: MyRenderer.as, test.mxml (both shown at end of post). IDE gives the errors listed below. Any ideas? I thought the compiler was smart enough to resolve the MyRenderer.CellField reference using the xmlns="*" attribute of the mx:Application tag.

      1120: Access of undefined property CellField. test.mxml
      1172: Definition MyRenderer:CellField could not be found.
      1120: Access of undefined property CellField. test.mxml
      1120: Access of undefined property CellField. test.mxml
      1120: Access of undefined property CellField. test.mxml

      MyRenderer.as:
      // ActionScript file
      package MyRenderer {
      import mx.controls.*;
      import mx.core.*;

      public class CellField extends TextInput
      {
      public function CellField() {
      height=60;
      width=80;
      setStyle("borderStyle", "none");
      editable=false;
      }

      override public function set data(value:Object):void {
      super.data = value;
      if (value != null) {
      text = super.listData.text;
      if (Number(super.listData.text) > 100) {
      setStyle("backgroundColor", 0xff0000);
      }
      }
      super.invalidateDisplayList();
      }
      }
      }

      test.mxml:
      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" height="600" width="600" xmlns="*">
      <mx:Script>
      <![CDATA[

      [Bindable]
      public var mydp:Array =
      [
      {Monday: 12, Tuesday: 22, Wednesday: 452, Thursday: 90},
      {Monday: 258, Tuesday: 22, Wednesday: 45, Thursday: 46},
      {Monday: 4, Tuesday: 123, Wednesday: 50, Thursday: 95},
      {Monday: 12, Tuesday: 52, Wednesday: 111, Thursday: 20},
      {Monday: 22, Tuesday: 78, Wednesday: 4, Thursday: 51}
      ];
      ]]>
      </mx:Script>

      <mx:DataGrid id="myDatagrid" dataProvider="{mydp}" variableRowHeight="true">
      <mx:columns>
      <mx:DataGridColumn dataField="Monday" itemRenderer="MyRenderer.CellField"/>
      <mx:DataGridColumn dataField="Tuesday" itemRenderer="MyRenderer.CellField"/>
      <mx:DataGridColumn dataField="Wednesday" itemRenderer="MyRenderer.CellField"/>
      <mx:DataGridColumn dataField="Thursday" itemRenderer="MyRenderer.CellField"/>
      </mx:columns>
      </mx:DataGrid>
      </mx:Application>
        • 1. Re: item Renderer in ActionScript
          Nataliefay
          Hi,

          I'm sorry to bug you with a non-technical discussion, but I am a recruiter in San Diego. My client is in need of 3 Senior Flex Developers for their project. I have had an extremely rough time finding someone for this position. Would you be interested in this position, or do you know of anyone that might be? We do pay referral fees. This position may be open to telecommuting.

          Job Description:
          They are in the midst of a major re-architecting of their Corporate Management system utilizing many cutting edge technologies. As it relates to the position they are using Flex as their UI.

          This is either a contract, or a full-time position.

          Pay: Market Rate

          Thanks for your help!

          Natalie Fay
          Outsource Technical
          www.ostechnical.com
          nfay@ostechnical.com
          858.874.5637