----- Original Message ----- 
From: "Paul Andrews" <[EMAIL PROTECTED]>
To: <flexcoders@yahoogroups.com>
Sent: Wednesday, October 31, 2007 8:45 AM
Subject: Re: [flexcoders] How do I set a panel title


> ----- Original Message ----- 
> From: <[EMAIL PROTECTED]>
> To: <flexcoders@yahoogroups.com>
> Sent: Wednesday, October 31, 2007 3:25 AM
> Subject: Re: [flexcoders] How do I set a panel title
>
>
>> Paul Andrews wrote:>
>> >
>> >
>> > > so I tried
>> > > myPanel set title("This is the new title" );
>> > >
>> > > I didn't really expect it to work
>> > > I got this error
>> > > Error: Syntax error: expecting rightbrace before set.
>> > >
>> > > How do I do this ?
>> >
>> > myPanel.title="This is the new title";
>> >
>> > What you are seeing is the syntax for a setter function.
>> >
>>
>> > Paul
>> Ok thanks, now I faintly remember that the getter makes the simple a=b
>> syntax possible. But I thought the whole idea was so the property could
>> be private. The title is public . .
>
> You can use a setter to provide public access to a private property, but 
> it
> can also be used to allow other code to be run whenever the property is 
> set
> (or in a getter, get). It's also possible to have a private property of 
> one
> type with a setter whose type is something completely different. It's not
> always just about accessability.

One use I didn't mention is to validate the value that the property is being 
set to. 

Reply via email to