Viewing by month: June 2009

  • Do you have a class with read only properties?
  • Need to bind to those properties?
  • Getting: warning: unable to bind to property 'propertyName' on class 'com.example.package::ClassName'?

Add the Bindable metatag to your function and specify an event to be associated with it's update.

package com.example.package {
    import flash.events.Event;
    import flash.events.EventDispatcher;
   
    import mx.collections.ArrayCollection;

    public class ClassNameextends EventDispatcher {
        private var _myExposedVar:ArrayCollection;

        public function ClassName() { }

        public function set resultsObject(value:Object):void {
            /* Do Stuff with resultsObject and update _myExposedVar */
            this.dispatchEvent(new Event("ResultsUpdated") );
        }

        [Bindable(event="ResultsUpdated")]
        public function get myExposedVar ():ArrayCollection {
            return this._myExposedVar;
        }

    }
}

Problem solved.

I was trying to access an ColdSpring generated remote facad from Flex this morning when I got this error. It worked just fine by calling CFINVOKE and by calling the CFC directly in the browser. From my flash/flex app it however did not work. I hit my head for several minutes before finding the utmost simple solution.

I have multiple CF instances and it turns out that I did not fully setup the current instance to my liking. So if you see this error, check to make sure that your use-mappings settings is set to true in your services-config.xml file. Flipping this switch resolved my issue.

<use-mappings>true</use-mappings>