RE: [flexcoders] loading attributes in a flex custom tag

2008-07-07 Thread Tracy Spratt
Don't set them in the constructor, implement them as public properties.
If variables, make the [Bindable], or use getter/setter methods for full
control.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Fernando Wermus
Sent: Monday, July 07, 2008 1:30 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] loading attributes in a flex custom tag

 

Hi all!

 I have a custom component made by myself. I have to asign the
values from the tag's attributes to some object when they are being
created in the constructor custom component time. The problem is that
Flex doesn't load the attributes when it calls the the constructor and
therefore I cant constructor the component. I hope you understand.

 

Thanks!

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://www.linkedin.com/in/fernandowermus 
http://mientretiempo.blogspot.com/ http://mientretiempo.blogspot.com/


 



Re: [flexcoders] loading attributes in a flex custom tag

2008-07-07 Thread Fernando Wermus
What about the order? Flex loads randomly the attributes. I have one called
autoplay that if it is set in true play a song, but first I need Flex sets
the url attribute. How can I manage this?

Thnks

On Mon, Jul 7, 2008 at 10:50 AM, Tracy Spratt [EMAIL PROTECTED] wrote:

Don't set them in the constructor, implement them as public
 properties.  If variables, make the [Bindable], or use getter/setter methods
 for full control.



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Fernando Wermus
 *Sent:* Monday, July 07, 2008 1:30 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] loading attributes in a flex custom tag



 Hi all!

  I have a custom component made by myself. I have to asign the values
 from the tag's attributes to some object when they are being created in the
 constructor custom component time. The problem is that Flex doesn't load the
 attributes when it calls the the constructor and therefore I cant
 constructor the component. I hope you understand.



 Thanks!

 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus
 http://mientretiempo.blogspot.com/

 




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


RE: [flexcoders] loading attributes in a flex custom tag

2008-07-07 Thread Tracy Spratt
That would be a good candidate for a setter funcion.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Fernando Wermus
Sent: Monday, July 07, 2008 3:26 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] loading attributes in a flex custom tag

 

What about the order? Flex loads randomly the attributes. I have one
called autoplay that if it is set in true play a song, but first I need
Flex sets the url attribute. How can I manage this?

 

Thnks

On Mon, Jul 7, 2008 at 10:50 AM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Don't set them in the constructor, implement them as public properties.
If variables, make the [Bindable], or use getter/setter methods for full
control.

 

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Fernando Wermus
Sent: Monday, July 07, 2008 1:30 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: [flexcoders] loading attributes in a flex custom tag

 

Hi all!

 I have a custom component made by myself. I have to asign the
values from the tag's attributes to some object when they are being
created in the constructor custom component time. The problem is that
Flex doesn't load the attributes when it calls the the constructor and
therefore I cant constructor the component. I hope you understand.

 

Thanks!

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://www.linkedin.com/in/fernandowermus 
http://mientretiempo.blogspot.com/ http://mientretiempo.blogspot.com/





-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://www.linkedin.com/in/fernandowermus 
http://mientretiempo.blogspot.com/ http://mientretiempo.blogspot.com/


 



Re: [flexcoders] loading attributes in a flex custom tag

2008-07-07 Thread Fernando Wermus
I make it work overrading this function, but I don' t know why this is the
convenient way.


updateDisplayList

*override* *protected* *function* updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):*void*{

*if*(*this*._autoPlay  *this*.source!=*null*){

*this*.play();

}

}
If autoplay is true and source has the info, then play the music.





On Mon, Jul 7, 2008 at 12:54 PM, Tracy Spratt [EMAIL PROTECTED] wrote:

That would be a good candidate for a setter funcion.

 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Fernando Wermus
 *Sent:* Monday, July 07, 2008 3:26 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* Re: [flexcoders] loading attributes in a flex custom tag



 What about the order? Flex loads randomly the attributes. I have one called
 autoplay that if it is set in true play a song, but first I need Flex sets
 the url attribute. How can I manage this?



 Thnks

 On Mon, Jul 7, 2008 at 10:50 AM, Tracy Spratt [EMAIL PROTECTED]
 wrote:

 Don't set them in the constructor, implement them as public properties.  If
 variables, make the [Bindable], or use getter/setter methods for full
 control.



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Fernando Wermus
 *Sent:* Monday, July 07, 2008 1:30 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* [flexcoders] loading attributes in a flex custom tag



 Hi all!

  I have a custom component made by myself. I have to asign the values
 from the tag's attributes to some object when they are being created in the
 constructor custom component time. The problem is that Flex doesn't load the
 attributes when it calls the the constructor and therefore I cant
 constructor the component. I hope you understand.



 Thanks!

 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus
 http://mientretiempo.blogspot.com/




 --
 Fernando Wermus.

 www.linkedin.com/in/fernandowermus
 http://mientretiempo.blogspot.com/

 




-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://mientretiempo.blogspot.com/


RE: [flexcoders] loading attributes in a flex custom tag

2008-07-07 Thread Gordon Smith
You normally override commitProperties() when you want to be able to set
properties in any order and do something later after you know all their
values. To ensure that commitProperties() gets called, call
invalidateProperties() in the property setters.

 

Gordon Smith

Adobe Flex SDK Team

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Fernando Wermus
Sent: Monday, July 07, 2008 12:50 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] loading attributes in a flex custom tag

 

I make it work overrading this function, but I don' t know why this is
the convenient way.

 

updateDisplayList

override protected function updateDisplayList(unscaledWidth:Number,
unscaledHeight:Number):void{ 

if(this._autoPlay  this.source!=null){ 

this.play(); 

}

}

If autoplay is true and source has the info, then play the music. 

 

 



 

On Mon, Jul 7, 2008 at 12:54 PM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

That would be a good candidate for a setter funcion.

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Fernando Wermus
Sent: Monday, July 07, 2008 3:26 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: Re: [flexcoders] loading attributes in a flex custom tag

 

What about the order? Flex loads randomly the attributes. I have one
called autoplay that if it is set in true play a song, but first I need
Flex sets the url attribute. How can I manage this?

 

Thnks

On Mon, Jul 7, 2008 at 10:50 AM, Tracy Spratt [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:

Don't set them in the constructor, implement them as public properties.
If variables, make the [Bindable], or use getter/setter methods for full
control.

 

Tracy

 



From: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com
[mailto:flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com ]
On Behalf Of Fernando Wermus
Sent: Monday, July 07, 2008 1:30 PM
To: flexcoders@yahoogroups.com mailto:flexcoders@yahoogroups.com 
Subject: [flexcoders] loading attributes in a flex custom tag

 

Hi all!

 I have a custom component made by myself. I have to asign the
values from the tag's attributes to some object when they are being
created in the constructor custom component time. The problem is that
Flex doesn't load the attributes when it calls the the constructor and
therefore I cant constructor the component. I hope you understand.

 

Thanks!

-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://www.linkedin.com/in/fernandowermus 
http://mientretiempo.blogspot.com/ http://mientretiempo.blogspot.com/





-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://www.linkedin.com/in/fernandowermus 
http://mientretiempo.blogspot.com/ http://mientretiempo.blogspot.com/





-- 
Fernando Wermus.

www.linkedin.com/in/fernandowermus
http://www.linkedin.com/in/fernandowermus 
http://mientretiempo.blogspot.com/ http://mientretiempo.blogspot.com/