[flexcoders] Re: Flex2 flash_proxy/Proxy getProperty and Binding

2006-03-15 Thread Renaun Erickson
Mike,

Thanks for your idea,

I wrote this code myself to try and pin down a problem I am having.  I
can't get dynamic properties to bind.  

I tried the use namespace flash_proxy in the SomeClass.as and it
didn't help.

The SomeClass.mxml has a textarea that I am trying to bind the
instance of someClass with a dynamic property newAttribute to the
text property.

The button on the mxml changes the someClass.newAttribute to help with
 the testing of the binding of a dynamic property.

Renaun

--- In flexcoders@yahoogroups.com, Michael Schmalle
[EMAIL PROTECTED] wrote:

 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
developmenthttp://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ
 Computer
  software
developmenthttp://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw
 Software
  design and
developmenthttp://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=1pMBCdo3DsJbuU9AEmO1oQ
  Macromedia
 
flexhttp://groups.yahoo.com/gads?t=msk=Macromedia+flexw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=OO6nPIrz7_EpZI36cYzBjw
 Software
  development best
practicehttp://groups.yahoo.com/gads?t=msk=Software+development+best+practicew1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=f89quyyulIDsnABLD6IXIw
   --
  YAHOO! GROUPS LINKS
 
 
 -  Visit your group
flexcodershttp://groups.yahoo.com/group/flexcoders
 on the web.
 
 -  To unsubscribe from this group, send an email to:
 
[EMAIL PROTECTED][EMAIL PROTECTED]
 
 -  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
 Service http://docs.yahoo.com/info/terms/.
 
 
   --
 
 
 
 
 --
 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 
Yahoo! Groups Links

* To 

Re: [flexcoders] Re: Flex2 flash_proxy/Proxy getProperty and Binding

2006-03-15 Thread Michael Schmalle



That is what I thought, a bit more going on then just use namespace. I
was trying to look at the bindings but, honsetly I havn't tried that. :)

Peace, MikeOn 3/15/06, Renaun Erickson [EMAIL PROTECTED] wrote:




Mike,

Thanks for your idea,

I wrote this code myself to try and pin down a problem I am having. I
can't get dynamic properties to bind. 

I tried the use namespace flash_proxy in the SomeClass.as and it
didn't help.

The SomeClass.mxml has a textarea that I am trying to bind the
instance of someClass with a dynamic property newAttribute to the
text property.

The button on the mxml changes the someClass.newAttribute to help with
 the testing of the binding of a dynamic property.

Renaun

--- In flexcoders@yahoogroups.com, Michael Schmalle

[EMAIL PROTECTED] wrote:

 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
http://groups.yahoo.com/gads?t=msk=Web+site+design+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=L-4QTvxB_quFDtMyhrQaHQ

 Computer
  software
development
http://groups.yahoo.com/gads?t=msk=Computer+software+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=lvQjSRfQDfWudJSe1lLjHw

 Software
  design and
development
http://groups.yahoo.com/gads?t=msk=Software+design+and+developmentw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=1pMBCdo3DsJbuU9AEmO1oQ

 Macromedia
 
flex
http://groups.yahoo.com/gads?t=msk=Macromedia+flexw1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=OO6nPIrz7_EpZI36cYzBjw

 Software
  development best
practice
http://groups.yahoo.com/gads?t=msk=Software+development+best+practicew1=Web+site+design+developmentw2=Computer+software+developmentw3=Software+design+and+developmentw4=Macromedia+flexw5=Software+development+best+practicec=5s=166.sig=f89quyyulIDsnABLD6IXIw

  --
  YAHOO! GROUPS LINKS
 
 
  - Visit your group
flexcodershttp://groups.yahoo.com/group/flexcoders

  on the web.
 
  - To unsubscribe from this group, send an email to:
  
[EMAIL PROTECTED]
[EMAIL PROTECTED]
 
  - Your use of Yahoo! Groups is subject to the Yahoo! Terms of
  Service http://docs.yahoo.com/info/terms/.
 
 
  --
 
 
 
 
 --
 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