RE: [Flashcoders] accessing variables - AS3

2009-01-12 Thread Mendelsohn, Michael
Well, it's a method of the Object class, so I'd hazard to guess it will work 
with everything you create.

- MM


> Isn't that for an XML object?


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] accessing variables - AS3

2009-01-12 Thread Eric E. Dolecki
Isn't that for an XML object?

On Mon, Jan 12, 2009 at 3:47 PM, Mendelsohn, Michael <
michael.mendels...@fmglobal.com> wrote:

> You might also want to look into using this.hasOwnProperty(stringValue +
> "Amt") to make certain what you're looking for actually exists in the
> object in the first place.
>
> - MM
>
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] accessing variables - AS3

2009-01-12 Thread Eric E. Dolecki
I apologize, I forgot all about "this" and remembered it right after sending
the email to the list.
Thanks all :)

On Mon, Jan 12, 2009 at 3:36 PM, Nate Beck  wrote:

> this[stringValue + "Amt"] if you're trying to do it within the same class.
> On Mon, Jan 12, 2009 at 12:28 PM, Manish Jethani
> wrote:
>
> > On Tue, Jan 13, 2009 at 1:51 AM, Eric E. Dolecki 
> > wrote:
> > > I have forgotten how to do this... I'd like to set some variables like
> > this
> > > a var exists...
> > > zAmt
> > >
> > > now I'd like to set the value in a method...
> > > [ stringValue + "Amt"] = someValue;
> > >
> > > How do I compose that?
> >
> > That would be:
> >
> >  obj[stringValue + "Amt"] = someValue;
> >
> > where obj is the object that holds the property.
> >
> > Manish
> > ___
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
>
>
>
> --
>
> Cheers,
> Nate
> 
> http://blog.natebeck.net
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 
http://ericd.net
Interactive design and development
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] accessing variables - AS3

2009-01-12 Thread Mendelsohn, Michael
You might also want to look into using this.hasOwnProperty(stringValue +
"Amt") to make certain what you're looking for actually exists in the
object in the first place.

- MM

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] accessing variables - AS3

2009-01-12 Thread Dave Watts
> I have forgotten how to do this... I'd like to set some variables like this
> a var exists...
> zAmt
>
> now I'd like to set the value in a method...
> [ stringValue + "Amt"] = someValue;
>
> How do I compose that?

I think you can do this directly using getChildByName, or you can
directly reference the parent object as Manish mentioned.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/

Fig Leaf Software provides the highest caliber vendor-authorized
instruction at our training centers in Washington DC, Atlanta,
Chicago, Baltimore, Northern Virginia, or on-site at your location.
Visit http://training.figleaf.com/ for more information!
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] accessing variables - AS3

2009-01-12 Thread Manish Jethani
On Tue, Jan 13, 2009 at 1:51 AM, Eric E. Dolecki  wrote:
> I have forgotten how to do this... I'd like to set some variables like this
> a var exists...
> zAmt
>
> now I'd like to set the value in a method...
> [ stringValue + "Amt"] = someValue;
>
> How do I compose that?

That would be:

  obj[stringValue + "Amt"] = someValue;

where obj is the object that holds the property.

Manish
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] accessing variables - AS3

2009-01-12 Thread Nate Beck
this[stringValue + "Amt"] if you're trying to do it within the same class.
On Mon, Jan 12, 2009 at 12:28 PM, Manish Jethani
wrote:

> On Tue, Jan 13, 2009 at 1:51 AM, Eric E. Dolecki 
> wrote:
> > I have forgotten how to do this... I'd like to set some variables like
> this
> > a var exists...
> > zAmt
> >
> > now I'd like to set the value in a method...
> > [ stringValue + "Amt"] = someValue;
> >
> > How do I compose that?
>
> That would be:
>
>  obj[stringValue + "Amt"] = someValue;
>
> where obj is the object that holds the property.
>
> Manish
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



-- 

Cheers,
Nate

http://blog.natebeck.net
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders