I'm also confused by your mention of "an instance of an object
property". You have objects, which are instances of classes, and each
instance has properties, but there is no such thing as an instance of a
property.
 
Do you want to be able to set a property on an instance where the
property name isn't known until runtime? In that case you would write
 
    source[propertyName] = value
 
where source is an Object instance and propertyName is a String set by
the attributes
 
    source="{model.someObject.currentObject}" propertyName="name"
 
- Gordon

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Roman Protsiuk
Sent: Tuesday, March 13, 2007 8:06 AM
To: [email protected]
Subject: Re: [flexcoders] Passing an object reference as a property



Hard to understand what exactly do you need and how... :)
What is parent? Is it the object whose property you are trying to
access? Or is it the object which has 'model' as a property? In both
cases you can get property value by parsing the string your method gets.


R.


On 13 Mar 2007 07:17:12 -0700, Kevin <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

        

        I think I need to be a little clearer about what I need.

        let's say i have an instance of an object property somewhere:

        model.someObject.currentObject.name
<http://model.someObject.currentObject.name> 

        I want to pass that reference location (not the value) through a
component like this:

        source=" model.someObject.currentObject.name
<http://model.someObject.currentObject.name> "

        so that inside the component I can update the object using the
reference:

        (this is what I don't know how to do)
        parent[source] = someValue; 

        If I use the curly braces it just binds the object value (not a
location reference) to the property source.  It seems the <mx:Binding >
tag is doing a similar thing, but unfortunately it's one of those
classes that I can't look inside to see how they do it! 

        Does this make more sense about what I am trying to do?

        Thanks, Kevin
        





        On Mar 12, 2007, at 11:42 PM, Gordon Smith wrote: 


                

                I suspect you meant to say that trace(source) is tracing
out the string "model.someObject.currentObject" .
                 
                I think you want
                 
                   <comp:SomeCustomComponent source="{model.someObject.
currentObject}"/>
                 
                - Gordon

________________________________

                From: [EMAIL PROTECTED] ups.com <http://ups.com>
[mailto:[EMAIL PROTECTED] com] On Behalf Of Kevin
                Sent: Monday, March 12, 2007 8:22 PM
                To: [EMAIL PROTECTED] ups.com <http://ups.com> 
                Subject: [flexcoders] Passing an object reference as a
property
                
                

                I would like to pass an object path through a property
of another 
                class, but can't figure out how to do it.
                
                model.someObject.currentObject (the ML variable)
                
                <comp: SomeCustomComponent source="model.someObject.
currentObject" />
                
                class SomeCustomComponent {
                
                public var source:Object;
                
                function test(){
                
                trace(model.someObject.currentObjec) ;
                
                }
                
                }
                
                This outputs the string "model.someObject.currentObject"
rather than 
                the variable value at - model.someObject.currentObject
                
                thanks for the insight.
                
                - kevin
                
                


                

        


        


 

Reply via email to