Re: [flexcoders] Re: can NOT call method in component - Important MXML Lesson

2006-10-03 Thread Igor Costa



Could not figure out what problem do you really has.regards.On 10/3/06, Gordon Smith <[EMAIL PROTECTED]
> wrote:












  













I haven't been following this thread, but
if you find yourself putting the same 'change' handler on each instance of your
TimeText component, then you should instead make that handler part of the
DEFINITION of that component.

 

Although you could accomplish that by
registering it in an override of createChildren(), it would be more natural to
put it on the base tag of your component definition. It sounds like your
TimeText is an MXML component extending TextInput. In that case, TimeText.mxml
should look like this:

 

    TimeTextt.mxml:

 

    

    

   
private function procesTime(event:Event):void

   
{

   
...

   
}

   


    

 

That way, you can just write instances as 
and every one will automatically have processTime() as its change handler.

 

This is similar conceptually to defining
the component

 

    OKButton.mxml:

 

   


 

and writing  instead
of . Here you've set a property, rather
than an event handler, as part of the component's definition so you don't have
to set it on each instance.

 

- Gordon

 









From: [EMAIL PROTECTED]
ups.com [mailto:[EMAIL PROTECTED]
ups.com] On Behalf Of boy_trike
Sent: Tuesday, October 03, 2006
6:00 PM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] Re: can NOT
call method in component



 







Well Thanks, of course, it works FINE now, with your
suggestion. 

Now here is the important question..

I feel like I know flex pretty well (not too difficult to figure out how all of
the components 
work...maybe a 9 on a 0 - 10 scale).

However, my actionscript knowledge seems to be a 1 MINUS!. I would have had NO
idea to 
look for the createChildren function. where the heck do I learn that info?
would going to 
MAXX help ?? any books you want to recomend? (wanna consult for $$$ ??? )

Bruce

--- In flexcoders@yahoogroups.com,
"Michael Schmalle" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Since you are instantiating the component in an Application, the scope is
> off,
> 
> 
> 
> needs to be
> 
> 
> 
> I know that isnt what you wanted to here but the scope always refers to
the
> application everywhere except a component tag.
> 
> Why don't you add a listener in you custom component say in createChilren()
> 
> IE
> 
> override proected function createChildren():void
> {
> super.createChildren();
> addEventListener(Event.CHANGE, processTime, false, 0, true);
> }
> 
> 
> Peace, Mike
> 
> On 10/3/06, boy_trike <[EMAIL PROTECTED]> wrote:
> >
> > in my application, i am asking for time input in many places. right
now
> > I have a
> > change="processTime( event)" in the text input of each
time variable. (my
> > process time
> > parses the input". Of course, this requires that I import the
ProcessTime
> > function into each
> > component that uses it. I created a new component called TimeInput
based
> > on textInput and
> > added a public function processTime.
> >
> > When I try to use this component i.e.
> > 
> >
> > I get the error "call to possibly undefined method"
> >
> > Help
> >
> > Thanks
> > Bruce
> >
> > 
> >
> 
> 
> 
> -- 
> What goes up, does come down.
>










  













-- Igor Costawww.igorcosta.com

__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___



RE: [flexcoders] Re: can NOT call method in component - Important MXML Lesson

2006-10-03 Thread Gordon Smith












I haven't been following this thread, but
if you find yourself putting the same 'change' handler on each instance of your
TimeText component, then you should instead make that handler part of the
DEFINITION of that component.

 

Although you could accomplish that by
registering it in an override of createChildren(), it would be more natural to
put it on the base tag of your component definition. It sounds like your
TimeText is an MXML component extending TextInput. In that case, TimeText.mxml
should look like this:

 

    TimeTextt.mxml:

 

    

    

   
private function procesTime(event:Event):void

   
{

   
...

   
}

   


    

 

That way, you can just write instances as 
and every one will automatically have processTime() as its change handler.

 

This is similar conceptually to defining
the component

 

    OKButton.mxml:

 

   


 

and writing  instead
of . Here you've set a property, rather
than an event handler, as part of the component's definition so you don't have
to set it on each instance.

 

- Gordon

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of boy_trike
Sent: Tuesday, October 03, 2006
6:00 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: can NOT
call method in component



 







Well Thanks, of course, it works FINE now, with your
suggestion. 

Now here is the important question..

I feel like I know flex pretty well (not too difficult to figure out how all of
the components 
work...maybe a 9 on a 0 - 10 scale).

However, my actionscript knowledge seems to be a 1 MINUS!. I would have had NO
idea to 
look for the createChildren function. where the heck do I learn that info?
would going to 
MAXX help ?? any books you want to recomend? (wanna consult for $$$ ??? )

Bruce

--- In [EMAIL PROTECTED]ups.com,
"Michael Schmalle" ...> wrote:
>
> Hi,
> 
> Since you are instantiating the component in an Application, the scope is
> off,
> 
> 
> 
> needs to be
> 
> 
> 
> I know that isnt what you wanted to here but the scope always refers to
the
> application everywhere except a component tag.
> 
> Why don't you add a listener in you custom component say in createChilren()
> 
> IE
> 
> override proected function createChildren():void
> {
> super.createChildren();
> addEventListener(Event.CHANGE, processTime, false, 0, true);
> }
> 
> 
> Peace, Mike
> 
> On 10/3/06, boy_trike <[EMAIL PROTECTED]..> wrote:
> >
> > in my application, i am asking for time input in many places. right
now
> > I have a
> > change="processTime( event)" in the text input of each
time variable. (my
> > process time
> > parses the input". Of course, this requires that I import the
ProcessTime
> > function into each
> > component that uses it. I created a new component called TimeInput
based
> > on textInput and
> > added a public function processTime.
> >
> > When I try to use this component i.e.
> > 
> >
> > I get the error "call to possibly undefined method"
> >
> > Help
> >
> > Thanks
> > Bruce
> >
> > 
> >
> 
> 
> 
> -- 
> What goes up, does come down.
>






__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___






Re: [flexcoders] Re: can NOT call method in component

2006-10-03 Thread Michael Schmalle



Hi,Well, createChildren() is only one spot. I am a component dev so createChildren is a nice place to put event listeners that have to do with user interaction such as a change event. You know the control has to be created before that handler will be called.
There are quite a few books that come with flex. I don't know, I have been learning by creating things. ;-)> would going to MAXX help Ha, I don't think it would put you back any! :)Peace, Mike
On 10/3/06, boy_trike <[EMAIL PROTECTED]> wrote:













  



Well Thanks, of course, it works FINE now, with your suggestion.  

Now here is the important question..

I feel like I know flex pretty well (not too difficult to figure out how all of the components 
work...maybe a 9 on a 0 - 10 scale).

However, my actionscript knowledge seems to be a 1 MINUS!.  I would have had NO idea to 
look for the createChildren function.  where the heck do I learn that info?  would going to 
MAXX help ??  any books you want to recomend?  (wanna consult for $$$  ??? )

Bruce

--- In flexcoders@yahoogroups.com, "Michael Schmalle" <[EMAIL PROTECTED]> wrote:

>
> Hi,
> 
> Since you are instantiating the component in an Application, the scope is
> off,
> 
> 
> 
> needs to be
> 
> 
> 
> I know that isnt what you wanted to here but the scope always refers to the
> application everywhere except a component tag.
> 
> Why don't you add a listener in you custom component say in createChilren()
> 
> IE
> 
> override proected function createChildren():void
> {
>super.createChildren();
>addEventListener(Event.CHANGE, processTime, false, 0, true);
> }
> 
> 
> Peace, Mike
> 
> On 10/3/06, boy_trike <[EMAIL PROTECTED]> wrote:
> >
> >   in my application, i am asking for time input in many places. right now
> > I have a
> > change="processTime( event)" in the text input of each time variable. (my
> > process time
> > parses the input". Of course, this requires that I import the ProcessTime
> > function into each
> > component that uses it. I created a new component called TimeInput based
> > on textInput and
> > added a public function processTime.
> >
> > When I try to use this component i.e.
> > 
> >
> > I get the error "call to possibly undefined method"
> >
> > Help
> >
> > Thanks
> > Bruce
> >
> >  
> >
> 
> 
> 
> -- 
> What goes up, does come down.
>


  













-- What goes up, does come down.

__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___



[flexcoders] Re: can NOT call method in component

2006-10-03 Thread boy_trike
Well Thanks, of course, it works FINE now, with your suggestion.  

Now here is the important question..

I feel like I know flex pretty well (not too difficult to figure out how all of 
the components 
work...maybe a 9 on a 0 - 10 scale).

However, my actionscript knowledge seems to be a 1 MINUS!.  I would have had NO 
idea to 
look for the createChildren function.  where the heck do I learn that info?  
would going to 
MAXX help ??  any books you want to recomend?  (wanna consult for $$$  ??? )

Bruce



--- In flexcoders@yahoogroups.com, "Michael Schmalle" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> Since you are instantiating the component in an Application, the scope is
> off,
> 
> 
> 
> needs to be
> 
> 
> 
> I know that isnt what you wanted to here but the scope always refers to the
> application everywhere except a component tag.
> 
> Why don't you add a listener in you custom component say in createChilren()
> 
> IE
> 
> override proected function createChildren():void
> {
>super.createChildren();
>addEventListener(Event.CHANGE, processTime, false, 0, true);
> }
> 
> 
> Peace, Mike
> 
> On 10/3/06, boy_trike <[EMAIL PROTECTED]> wrote:
> >
> >   in my application, i am asking for time input in many places. right now
> > I have a
> > change="processTime( event)" in the text input of each time variable. (my
> > process time
> > parses the input". Of course, this requires that I import the ProcessTime
> > function into each
> > component that uses it. I created a new component called TimeInput based
> > on textInput and
> > added a public function processTime.
> >
> > When I try to use this component i.e.
> > 
> >
> > I get the error "call to possibly undefined method"
> >
> > Help
> >
> > Thanks
> > Bruce
> >
> >  
> >
> 
> 
> 
> -- 
> What goes up, does come down.
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

<*> To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/