A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Combining TextEvent with Dispatch event

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    567

    [RESOLVED]Combining TextEvent with Dispatch event

    [/]
    Last edited by eggler; 10-14-2009 at 02:11 AM. Reason: RESOLVED!

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Yep. You simply need to create your TextEvent properly.

    Code:
    var te:TextEvent = new TextEvent(TextEvent.TEXT_INPUT, false, false, "OPTION1");
    dispatchEvent(te);
    In general, I'd caution against using TextEvents for things that are not truly text related. Instead, you can create your own custom event type.

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    [/]
    Last edited by eggler; 10-14-2009 at 02:11 AM.

  4. #4
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Is this what you're trying to do?

    PHP Code:
    myTextField.dispatchEvent(new TextEvent(TextEvent.LINKfalsefalse'OPTION1')); 
    Or are you trying to customize the events off of the inline links...like so:

    PHP Code:
    myTextField.htmlText '<a href="event:OPTION1">linky</a>'

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    [/]
    Last edited by eggler; 10-14-2009 at 02:11 AM.

  6. #6
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Flax's example is assuming you are listening to 'this' with your eventListener...if you wanted to directly inject that event to the function you could pass it as an argument instead of going through the event structure:

    PHP Code:
    myHandler(new TextEvent(TextEvent.TEXT_INPUTfalsefalse"OPTION1")); 

  7. #7
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    [/]
    Last edited by eggler; 10-14-2009 at 02:11 AM.

  8. #8
    Senior Member
    Join Date
    Jan 2001
    Posts
    567
    [/]
    Last edited by eggler; 10-14-2009 at 02:10 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center