You want to look into getters and setters

Try this:

<mx:Script>
<![CDATA[
private var _myProperty;

public function get myProperty ( ) {
return _myProperty;
}

public function set myProperty ( value ) {
_myProperty = value;
}
]]>
</mx:Script>

Hope that'll be a good starting point.

Seth


On Mar 28, 2005, at 14:54, Andora, Greg wrote:

I'm wondering if there is a way (and if there is, how would I go about doing it) I can create a change event for a custom MXML class based for a public property.

For example, I have an MXML file called MyClass and when the parent application changes "myProperty" (i.e MyClass.myProperty=5), I want my custom class to respond by calling the private function myProperty_Changed():

<mx:Canvas xmlns:mx="http://www.macromedia.com/2003/mxml"
        width="{lookupWidth}"
        focusOut="" >
               
        <mx:Script>
                <![CDATA[
                        public var myProperty;

                        private function myProperty_Changed()
                                {
                                        Do Stuff Here when myProperty is changed by the application it is being used in;

                                }
                ]]>
        </mx:Script>
        <mx:TextInput id="text1" />
</mx:Canvas>



Thanks,
Greg Andora





Yahoo! Groups Sponsor

<x-tad-smaller>ADVERTISEMENT</x-tad-smaller>
<22305_0205_016_b_300250_a.gif>
<l.gif>

Yahoo! Groups Links

• To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
 
• To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
 
• Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




----
This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message.

To reply to our email administrator directly, send an email to
[EMAIL PROTECTED]

Littler Mendelson, P.C.
http://www.littler.com



Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to