get the TextInput text inside the different function?

It's all in a single class

method 1:

var txtInpt:TextInput = new TextInput();txtInpt.width = 250;searchInpt.text = "Text";txtInpt.addEventListener(MouseEvent.CLICK, clearSearch);txtInpt.addEventListener(KeyboardEvent.KEY_DOWN, onKeyBoardEvent);MyContainer.addChild(searchInpt);

method 1 creates a lot of UI for a container

method 2 - onKeyBoardEvent - check what was the key code:

private function onKeyBoardEvent(e:KeyboardEvent):void {
    if (e.keyCode == Keyboard.ENTER) {

    stage.focus = null;

// here is where i would trace the text info

    }

}

Since the entry of search is created in method 1, method 2 does not have access to this

How can I have access to the text entered in the txtInpt in my second method?

Thank you!

Hey dtater,

to access the textinput object, use this:

trace(e.currentTarget.text);

You should get what you want. Good luck!

Tags: BlackBerry Developers

Similar Questions

  • How to deal with the error "failed to get the kernel function pointer".

    I was running smoothly first Pro CC all day today. I stopped at the end of the day and now when I try to launch first yet, only a few hours later, the program will not open and I get the error "unable to get the kernel function pointer.  Help!

    I run first on a Macbook pro i5 processor at 2.3 Ghz with 16 GB RAM, graphic card 512 MB intel HD 3000 running OS 10.10.3.  It worked well (although sometimes a little slowly) for one year. I keep the project file on the portable hard drive, media files on a port firewire 800 Gdrive.  It has been working well.

    The only thing that happened between the first success today and refusal to open the first tonight, I ran something of card/holiday calendar interactive multimedia for my son that I had installed a few days ago but not yet opened. When he installed Abobe AIR opened and did the installation.  To see if this can help, I uninstalled the holiday card and rebooted the computer a couple of times. No dice.

    Help!  Luke

    I have the same problem on several machines. What seems to be the case is first is losing track hence basic audio filters are on the system. The only solution that works for me is uninstalling first, then put it back. I found myself to do this every day or almost.

  • How can I get the CONTROL function, click ON work?

    The CONTROL function, click ON does not work when I have my extra monitor plugged into my laptop. Any ideas on how to get this to work outside to unplug my extra monitor of my laptop to work?

    It works any differently if you switch to the external monitor as the main screen?

  • How do I get the multi-function of labview for data acquisition on my toolbar function for lv2011? It is a reload of your laptop has crashed.

    I had to reload our installation of LV and have lv2011 and NOR-DAQMX 9.9.    I can't get the range of DAQ function to display the toolbar funtioon.   I tried to fix the OR-DAQMX driver.   It showed message "installation lv2012 support" and "facility charge SP1 lv2012".  I have not seen a message of support from lv2011.

    There was a problem downloading of configuration and 2012SP1 was wrong as my group of licenses for the account representative.  This has since been uninstalled before installing 2011 (without SP1).

    Thanks in advance,

    Bill

    Updated the installation of the driver NOR-DAQMx vs repair.    Apparently, he saw the LV2011 and installed support files.   Everything works now.

  • How to get the same functionality for string as java in oracle 10g

    Example:

    In java, if I use
    -> > >
    String.format ("% 03d", 11) then he will give me the result 011
    String.format ("% 03d", 1111) then he will give me the result 1111

    I need also same result in Oracle for a stored procedure. I used to_char() and lpad() function but could not get the desirable.

    I'm new on this. Please forgive for this silly question and help me.

    Or with the prefix "FM", which makes the FILLING for us:

    to_char(col1, 'fm9999099')
    
  • How can I get the old function to choose which page I want to go back to? I run Firefox 8.0.1.

    In older versions of Firefox, the back button has a small chip of a button allowing you to return to a specific page, until like 10 pages back. So if you knew that you wanted to go back two or three pages, you don't have to hit the back two or three times, you simply press this button and then select the page you wanted back. Can I have this option in Firefox 8.0.1? Thank you

    Click and hold the unified back / next button, or right-click to get the rear / front in the history of this tab.

    Or install this extension to get the restored former "drop-marker" button.

    https://addons.Mozilla.org/en-us/Firefox/addon/backforedrop/

  • I get the wrong function (0 * 80070001) when trying to complete pc restore and then stop errors prices 0 * 000000F4, 0 * 00000003, 0 * 8F59E9F8, 0 * 8F59eB4 0 * 8545B 710

    I am running windows vista and when he began the download of an update that it crashed and now when it turns on, I get the blue screen. After trying to repair it using the wizard, he finds nothing, so I try to the motor pump reinstall my computer from scratch disks but just comes up with an error immediately. also, I tried using f8 when it lights up and the attempt to restart from the last successful boot but this also fails and also turn off automatic restart after that accident fails please help.

    Hi paulspeedgun,

    Blue screen errors you get point of hardware failure or an incompatible driver. Have you recently installed a new hardware?  Below are troubleshooting steps to resolve your problem. Try each method until your problem is solved.

    -Disconnect all hardware devices on the computer and then restart to see if that solved the problem.

    -Restart your computer and immediately press theF8 key until you reach the Advanced Startup Optionsmenu.  In the menu, select Safe Mode and perform a System Restoreto restore your computer to a date prior to this issue.

    -Restart your computer and immediately press theF8 key until you reach the Advanced Startup Optionsmenu.  In the menu select Safe Mode with command prompt , type chkdsk /r to check the integrity of your hard drive.  Make sure you have all the important data to backup to a backup.

    -Insert your Windows disk and restart your computer from the disk. Clickrepair your computer, Next, select the operating system you want to repair and clickNext.  Select The Windows Memory Diagnostic tool to check the consistency of your memory. Let this test for a few hours for best results.

    Dena
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Feature request: get the last function of room in the server to Server API

    Hello

    I would like to be able to get the last created room, check the number of users here already and if there is still place send the user or create a new.

    At the moment I can achieve either

    1. make a call to listRooms, then a getroominfo for the final room, but if the number of rooms become great this can slow the app.

    2. I could also store the statistics of the room on my server.

    What do you think?

    #2 sounds like the way to go for me =).

    Nigel

  • BlackBerry 10 I can't get the copy function Chat works in text Messages

    I used the function of copy cat before copying complete history in text messages and paste it into a document of Docs To Go.  The conversation goes, the process seems to slow down, but it always worked.  Now I find that it works at all.  I use to save chat history in the same way that I save e-mail conversations.

    curious_joe wrote:

    The copy cat worked for me until recently when it suddenly stopped. No error message.

    Yes, they had too much time, I suspect.

  • Can not get the StartDrag function index number

    //*//*//*//*//**//**/**//**//**//**//**//**//**//**//**//**//**//

    var t:Array = new Array();
    t = (d1, d2, d3, d4, d5);

    var d: Array = new Array();
    d = [t1, t2, t3, t4, t5];

    // ** // ** //
    var ust:int;

    for (var i: int = 0; i < Extremity; i ++) {}
    t [i] .addEventListener (MouseEvent.MOUSE_DOWN, mouseDowner);
    }


    for (var j: int = 0; j < Extremity; j ++) {}
    t [j] .addEventListener (MouseEvent.MOUSE_UP, mouseReleased);
    }

    function mouseDowner(event:MouseEvent):void {}
    event.target.startDrag ();
    trace (t.IndexOf (MovieClip (Event.Target)));
    var ast:int;
    AST = t.IndexOf (MovieClip (Event.Target));
    trace (AST);
    UST = AST.valueOf ();
    }

    function mouseReleased(event:MouseEvent):void {}
    event.target.stopDrag ();
    {if (d.IndexOf ((Event.Target) MovieClip. {(DropTarget.parent)! =-1)}
    trace (d.IndexOf ((Event.Target) MovieClip. DropTarget.parent)) ;}


    else {trace ("not appropriate") ;}
    trace ((Event.Target) MovieClip. DropTarget.parent.Name);
    }


    var tf1:TextField = new TextField();
    TF1. Text = "Light";
    TF1.x =-30;
    TF1.y =-30;
    T1. AddChild (TF1);
    TF1.mouseEnabled = false;

    var tf2:TextField = new TextField();
    TF2. Text = "Easy";
    TF2.x =-30;
    TF2.y =-30;
    T2. AddChild (TF2);
    TF2.mouseEnabled = false;

    var tf3:TextField = new TextField();
    TF3. Text = "Failed";
    TF3.x =-30;
    TF3.y =-30;
    T3. AddChild (TF3);
    TF3.mouseEnabled = false;

    var tf4:TextField = new TextField();
    TF4. Text = "Fast";
    TF4.x =-30;
    TF4.y =-30;
    T4. AddChild (TF4);
    TF4.mouseEnabled = false;

    var tf5:TextField = new TextField();
    tf5. Text = "Ugly";
    tf5.x =-30;
    tf5.y =-30;
    T5. AddChild (tf5);
    tf5.mouseEnabled = false;

    //**//**//**

    var tf6:TextField = new TextField();
    TF6. Text = "Dark";
    TF6.x =-30;
    TF6.y =-30;
    D1. AddChild (TF6);
    TF6.mouseEnabled = false;


    var tf7:TextField = new TextField();
    TF7. Text = "difficult";
    TF7.x =-30;
    TF7.y =-30;
    D2. AddChild (TF7);
    TF7.mouseEnabled = false;


    var tf8:TextField = new TextField();
    TF8. Text = "possible";
    TF8.x =-30;
    TF8.y =-30;
    D3. AddChild (Tf8);
    TF8.mouseEnabled = false;


    var tf9:TextField = new TextField();
    tf9. Text = "Slow";
    tf9.x =-30;
    tf9.y =-30;
    D4. AddChild (tf9);
    tf9.mouseEnabled = false;


    setChildIndex (d5, 1);
    var tfh:TextField = new TextField();
    TFH. Text = "BEAUTIFULL";
    TFH.x =-30;
    TFH.y =-30;
    D5. AddChild (TFH);
    tfh.mouseEnabled = false;

    setChildIndex (d [0], 0);
    setChildIndex (d [1], 0);
    setChildIndex (d [2], 0);
    setChildIndex (d [3], 0);
    setChildIndex (d [4], 0);

    trace (UST);

    All traces in the function show what do you expect?  If so, what did you conclude that the ust variable is not assigned the ast value?

    A thing I would recommend is to use "event.currentTarget" instead of "event.target", just to be sure that the object to drag the object with the listener who are entrusted to him.  Otherwise, the goal could be another object inside the object with the assigned listener.

  • How can I get the search function when I right click?

    I recently ran an update. Now, I don't have the function "search" when I right-click. I've used it widely and would really like the option to return. I had to uninstall certain things when I ran the update, because I didn't want the search engine or the toolbar that automatically installed with the update. How to bring back my right click search function?

    You are not yet on the most current version of Firefox and all ads "You have won" do not come from Firefox, they are malware or Web site ads. Follow these steps:

    Update to the latest version of Firefox

    Fix Firefox problems caused by malicious software

    Firefox - modules to reset and refresh settings

  • clean install of Vista on an old drive hard ide after drive failure hard sata - oem version now get "the limited functionality" due to "unauthorized changes" had no problems for 3 years until this!

    I did a clean install of vista on an old drive hard ide after the disk sata hard down - (oem version) now get "feature limited" because of the "unauthorized modification" had no problems for 3 years until this!

    Hello

    It's a shame you don't know the exact name of the virus

    Malware can cause non-genuine messages appear

    but try this:

    Download update and scan with the free version of malwarebytes anti-malware

    http://www.Malwarebytes.org/MBAM.php

    You can also download and run rkill to stop the process of problem before you download and scan with malwarebytes

    http://www.bleepingcomputer.com/download/anti-virus/rkill

    If it does not remove the problem and or work correctly in normal mode do work above in safe mode with networking

    Windows Vista

    Using the F8 method:

    1. Restart your computer.
    2. When the computer starts, you will see your computer hardware are listed. When you see this information begins to tap theF8 key repeatedly until you are presented with theBoot Options Advanced Windows Vista.
    3. Select the Safe Mode with networking with the arrow keys.
    4. Then press enter on your keyboard to start mode without failure of Vista.
    5. To start Windows, you'll be a typical logon screen. Connect to your computer and Vista goes into safe mode.
    6. Do whatever tasks you need and when you are done, reboot to return to normal mode.
  • How do you get the different backgrounds on several screens?

    I have a Setup dual monitor and would like to have a different wallpaper on each. How this is done?

    May be of help to the: http://www.howtogeek.com/howto/windows/dual-monitors-use-a-different-wallpaper-on-each-desktop/

  • How to get the different records for the date max.

    Hi all

    Here is the sample sql for sample table and data.

    Create table student (dept_id number(10), first_name varchar2(10),last_name varchar2(10),join_date date,years_attended number(10));

    insert into student values (1,'Ann','Coleman',to_date('3/7/1917','MM/DD/YYYY'),4);
    insert into student values (1,'Ann','Coleman',to_date('3/7/1916','MM/DD/YYYY'),5);
    insert into student values (2,'Rock','Star',to_date('1/1/1920','MM/DD/YYYY'),5);
    insert into student values (2,'Rock','Star',to_date('1/1/1921','MM/DD/YYYY'),6);
    insert into student values (3,'Jack','Smith',to_date('7/1/1900','MM/DD/YYYY'),3);

    insert into student values (3,'Jack','Smith',to_date('7/1/1901','MM/DD/YYYY'),4);

    commit;

    I need to get maximum date records when the name and dep_id corresponds to. I wrote the query below and it becomes the expected result, but I'm not sure it's quite effective.

    SELECT s.dept_id, s.first_name,s.years_attended

    FROM (SELECT dept, MAX (join_date) join_date

    STUDENT GROUP BY dept_id) x

    Student JOIN s ON x.dept_id = s.dept_id AND x.join_date = s.join_date;

    This above query returns records like below, and this is the goal.

    DEPT_ID NAME YEARS_ATTENDED

    1                         Ann                                4

    2                         Rock                              6

    3                         Jack                              4

    Can you please let me know the query SQL I wrote is effective or not? This sample table may have less data, but I'm dealing with millions of records.

    Hello

    Thanks for posting CREATE TABLE and INSERT statement. This really helps.

    Here's a solution. I also added a name that seems logical. In which case you can delete:

    Select dept_id, first_name, last_name

    , max (years_attended) Dungeon years_attended (last dense_rank order by join_date)

    the student

    Group of dept_id, first_name, last_name;

    DEPT_ID FIRST_NAME LAST_NAME YEARS_ATTENDED

    ---------- ---------- ---------- --------------

    1 Ann Coleman 4

    Rock 2 star 6

    3 Jack Smith 4

    Kind regards.

    Alberto

  • How can I change the parameters of the actions within a function using the different function

    Can not think of another way to ask, I have looked EVERYWHERE and tried to do my best of my knowledge, but no luck.
    Suppose I got 10 squares respectfully named sq1, sq2... sq10 and I have a 10 button that, when you press on, calls a function that makes his respectful place move and changes color. This would be a problem if she had only 10 squares and just do 2 actions, simply change the name of the instance of each function... something like:

    Button1.onPress = movesquare1 ();

    Button2.onPress = movesquare2();

    ... and so on

    function movesquare1 ();

    SQ1._x = sq._x + 1;

    function movesquare2 ();

    SQ2._x = sq._x + 1;

    ... and so on

    is it possible to have a function General movesquare, designate a variable N so that when a button is pressed the N variable would be designated?

    something like:

    Button1.onPress = movesquare (n = 1)

    function movesquare ();

    SQN._x = sqn._x + 1;

    This way I don't that the change in n = 1 so that it points to the right sq and that avoiding wrote MANY movesquare functions for each sq...

    Long post but I tried to explain my dilemma it the best way possible.

    Tried to use var: String and var: number but no luck...

    Thank you very much

    You can make use of notation of support use of target objects string values.  First think in terms of pass a number to such function as shown below...

    Button1.onPress = function() {movesquare("1")};

    Button2.onPress = function() {movesquare("2")};

    function movesquare (num) {}

    This ["sq" num] ._x plus sq._x + 1;

    }

Maybe you are looking for