I little bit more to clarify:

You should have a variable defined and set in your application that
stores the text you'd like to pass/use when the event is triggered:

public var val1:String="Hello"; // defined and set for use elsewhere

To be complete you need to define the someFunction (this was just an
example) elsewhere in you application:

public function someFunction():Void{ // do stuff pehaps with val1 etc.}

As to the mouse event vs mouse event type, check here:

http://livedocs.macromedia.com/labs/1/flex/langref/flash/events/MouseEvent.html

Hope this helps

--- In [email protected], "bhaq1972" <[EMAIL PROTECTED]> wrote:
>
> Thanks Darin for your input, i would like to ask some further 
> questions on your suggestions.(appreciate your help).
> 
> > this.addEventListener(MouseEventType.CLICK, myClickFunction);
> 
> you mean MouseEvent.CLICK?
> 
> > this.parent.addEventListener("myEvent", someFunction);
> 
> I'm sure thats a compile error (compiler will say "cant 
> find 'somefunction' etc"). 
> 'someFunction' lives in this.parent (actually this.parentDocument if 
> you take my original question)
> 
> > dispatchEvent({type:"myEvent", val1:"hello"});
> > dispatchEvent(new Event("myEvent));
> 
> but what about my 'val1' value ("hello");
> 
> 
> The docs don't give enough info
> 
> regards 
> bod
> 
> 
> 
> 
> --- In [email protected], "Darin Kohles" <[EMAIL PROTECTED]> wrote:
> >
> > A couple fo issues here:
> > 
> > function startUp():Void
> > {
> > /* event listener needs target (this) event to listen for
> > (MouseTypeEvent.CLICK) and what to do about it (myClickFunction - 
> stay
> > away from using key words like 'click' for custom functions */
> > this.addEventListener(MouseEventType.CLICK, myClickFunction);
> > 
> > /* same goes here, notice change in syntax target.|event|function 
> */
> > this.parent.addEventListener("myEvent", someFunction);
> > 
> > dispatchEvent(new Event("myEvent));
> > }
> > 
> > myClickFunction(event:Event):Void {// some stuff here}
> > 
> > If you want to send information using an an event you'll need to 
> find
> > a different mechanism e.g. a global variable, or another interface
> > function that is step up to pass data. The event listener is more 
> to
> > say 'when' something happens, not 'what' is to happen.
> > 
> > Good Luck
> > 
> > --- In [email protected], "bhaq1972" <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi 
> > > i've got a knowledge issue.
> > > what does this flex 1.5 code translate to
> > > Flex 1.5 
> > > --------
> > > function startUp():Void
> > > {
> > >  this.addEventListener("click", this);
> > >  this.addEventListener("myEvent", this.parentDocument);
> > >  
> > >  dispatchEvent({type:"myEvent", val1:"hello"});
> > > }
> > > 
> > > function click(event):Void
> > > {
> > >   //do something
> > > }
> > > 
> > > flex 2 ??
> > > ---------
> > > import flash.events.Event; //do i have to add this all the time
> > > 
> > > private function startUp():Void
> > > {
> > >  this.addEventListener(MouseEvent.CLICK, this);
> > >  this.addEventListener("myEvent", this.parentDocument);
> > > 
> > >  dispatchEvent({type:"myEvent", val1:"hello"});//????
> > > }
> > > 
> > > private function click(event:Event):Void
> > > {
> > >  //do something
> > > }
> > >
> >
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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/

<*> 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/
 


Reply via email to