Yeah spot on,
I'm after the reference, not the primitive value.
The this[ 'myVal'+i ] idea was already proposed to me.
I guess what i'm looking for is a way to store the reference to the
bindable value in an array so that i can access via an array integer
index rather than using array access notation.
Its is the same if i go,
[code]
[Bindable] var myVal:Boolean
update( myVal );
function update( val:Boolean ) {
val = true;
}
[/code]
Again i get the evaluated value and not the maintained reference.
Bjorn
On 08/03/2007, at 9:49 AM, Tracy Spratt wrote:
I am a bit out of my league here, but isn’t it the case that to do
what you want, you need an array or *references* to the variables?
And aren’t “primitive” data typed variables really literal values
and not references?
Hmm, if you can enforce a naming convention, you could do:
function {
for ( var i = 0; i<nSomeNumber; i++ ) {
this[“myVal “ + i ] = true;
}
}
(maybe a do while, instead of for?)
Tracy
From: flexcoders@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Bjorn Schultheiss
Sent: Wednesday, March 07, 2007 5:29 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Setting Multiple Bindable Properties
Hey Ya'll
let me eloborate, say i have:
[code]
[Bindable] var myVal1:Boolean;
[Bindable] var myVal2:Boolean;
[/code]
and i want to update the values (which in turn would update the
'view' ) via an array loop, intuitively i would code
[code]
function {
var myArray = [ myVal1, myVal2 ]
for ( var i = 0; i<myArray.length; i++ ) {
myArray[ i ] = true;
}
}
[/code]
Of course this does not update the bindable values but rather the
arrays' indexed items.
How can i achieve this result?
Regards,
Bjorn