Well, I was just in this classroom the other day. If I get your question correctly..

Add;

use namespace flash_proxy;

right under the import flash.util.flash_proxy.

If you got this code from an example, it was missing the use statement. I missed this also!, Once the use is in there it works great!

Peace, Mike

On 3/15/06, Renaun Erickson <[EMAIL PROTECTED]> wrote:
The sample code is located below.  I am trying to find a way to bind
dynamic attributes (when using Proxy class).  I can't get the dynamic
properties to bind, any suggestions or help would be appreciated.

Renaun

Proxy Class:
package {
      import flash.util.flash_proxy;
      import flash.util.Proxy;

      dynamic public class SomeClass extends Proxy {

            public var _dynamicAttributeArray:Array;

            public function SomeClass() {
                  _dynamicAttributeArray = new Array();
            }           
     
            flash_proxy override function getProperty( name : * ) : * {
                  return _dynamicAttributeArray[ name ];
            }
     
            flash_proxy override function setProperty(name:*, value:*):void {
                  _dynamicAttributeArray[ name ] = value;
            }
      }
}


Now if I have:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*"
      creationComplete="initApplication()">
      <mx:VBox width="100%" height="100%">
            <mx:TextArea width="100%" height="50%" id="output" text="{
SomeClass(someClass).newAttribute }"/>
            <mx:Button label="Change" click="someClass.newAttribute = '' + new
Date();"/>
      </mx:VBox>
      <mx:Script>
            <![CDATA[
                  import SomeClass ;
            public var someClass:SomeClass;
           
                  public function initApplication()
                  {
                      someClass = new SomeClass();
                      someClass.newAttribute = "I am New";
                      //output.text = someClass.newAttribute;
                  }

            ]]>
      </mx:Script>
</mx:Application>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS






--
What goes up, does come down.

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to