AS3 capture text from user input. Buttons generate errors

I use AS3 on the timeline. I have a clip of three pages (dynamic_mc). Each page is labeled p1... P3.
P1 I have one named userName text box and a button named next_1. I have a dynamic text box named greetings_1, a field of text named schoolName and two buttons (back1 and next2) p2.
P3 I have another dynamic text box named greetings_2 and two buttons (back_2 and next_3).

PROBLEM:

About user enters name p1, which is captured on p2. Once a click on the next button on p1, I get this error:

TypeError: Error #1009: cannot access a property or method of a null object reference.
at FlashCS4_Curriculum_fla::lesson9_pg6_dynamic_122/frame10()
at flash.display::MovieClip/gotoAndStop()
at FlashCS4_Curriculum_fla::lesson9_pg6_dynamic_122/goP2()

Why do I get an error when you use the buttons? Is there a better way to capture the entered text?


Here is the code of the page.

Page 1 = p1
Stop();
var hisName:String;

next_1.addEventListener (MouseEvent.CLICK, goP2);
function goP2(evt:MouseEvent): void
{
promised = userName.text;
gotoAndStop ("p2");
}

page 2 = p2

greetings_1.text = ' welcome: "+ promised;
School of the var: String;

Next button
Next_2.addEventListener (MouseEvent.CLICK, goP3);
function goP3(evt:MouseEvent): void
{
School = schoolName.Text;
gotoAndStop ("p3");
}

back button
back_1.addEventListener (MouseEvent.CLICK, goP1);
function goP1(evt:MouseEvent): void
{
gotoAndStop ("p1");
}

page 3 = p3

greetings_2.text = promised + "is the name of your school:" + schoolName;


Next button
next_3.addEventListener (MouseEvent.CLICK, goP1a);
function goP1a(evt:MouseEvent): void
{
gotoAndStop ("p1");
}

back button
back_2.addEventListener (MouseEvent.CLICK, goP2a);
function goP2a(evt:MouseEvent): void
{
gotoAndStop ("p2");
}


Thanks for any help

German

Click on file/publish settings/flash/and check enable debugging.  Repeat the test.

the line of code causes the error appears in the error message.  What is the line of code that references the user name?  If so, there is no object with this instance name in the frame that contains this code.

Tags: Adobe Animate

Similar Questions

  • Help escaping from user input, whatever they are

    I need help escaping from the user input whatever they may be. Currently, I did the following searches with no luck.

    CONTAINS (columnName, ' % a %', 1) > 0
    CONTAINS (columnName, '% {%}', 1) > 0

    Looking for a Word with a "%' in it as follows"stocks have increased by 13%."

    You must put the % as a printjoin in a lexer and use this lexer in the index settings in order for the % to include in the indexed tokens. Then you can use-to escape to the % as an individual character. You cannot combine sentences using the {and} with wildcard characters who escape. Please see the demo below.

    SCOTT@orcl_11gR2> -- table:
    SCOTT@orcl_11gR2> create table test_tab
      2    (columnName  clob)
      3  /
    
    Table created.
    
    SCOTT@orcl_11gR2> -- lexer with % included in printjoins:
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference ('test_lex', 'basic_lexer');
      3    ctx_ddl.set_attribute ('test_lex', 'printjoins', '%');
      4  end;
      5  /
    
    PL/SQL procedure successfully completed.
    
    SCOTT@orcl_11gR2> -- index using lexer:
    SCOTT@orcl_11gR2> create index test_idx
      2  on test_tab (columnName)
      3  indextype is ctxsys.context
      4  parameters
      5    ('lexer test_lex
      6        transactional')
      7  /
    
    Index created.
    
    SCOTT@orcl_11gR2> -- test data:
    SCOTT@orcl_11gR2> insert all
      2  into test_tab (columnName) values ('The shares have increased by 13%.')
      3  into test_tab (columnName) values ('other data')
      4  select * from dual
      5  /
    
    2 rows created.
    
    SCOTT@orcl_11gR2> commit
      2  /
    
    Commit complete.
    
    SCOTT@orcl_11gR2> -- query:
    SCOTT@orcl_11gR2> select * from test_tab
      2  where  contains (columnName, '%\%%') > 0
      3  /
    
    COLUMNNAME
    --------------------------------------------------------------------------------
    The shares have increased by 13%.
    
    1 row selected.
    
  • Shoot/Get/the data value of the window for user input

    I'm trying to do something that should be simple enough for a programmer, but unfortunately, unfortunately to be a designer, I'm having a devil of a time with it.  After spending hours searching and trying different things, I thought to post the problem.  I have the feeling that I'm not the first creator of evil with it.

    I'm trying to extract a window input data and to transmit it to a variable.  In the script, I do a few purge(), and I don't know if that clears the values of input from the user during the script, but it's thinking ahead...

    I need the values to:

    Layer.translate (X, Y) / / if I'm wrong, it must be not - string

    bitsaveoptions. Method = ChanelScreen; in menu drop-down

    bitsaveoptions.angle = KAngle / / if I am mistaken, this must not be one - integer

    bitsaveoptions. Frequency = ChanelFrequency; If I am mistaken, this must not be one - integer

    bitsaveoptions. Resolution = ChanelResolution; If I am mistaken, this must not be one - integer

    bitsaveoptions. Shape = BitmapHalfToneType.ROUND; in menu drop-down

    I know that there are different ways to retrieve data from a window how .value, and perhaps others, but I can't seem to extract the data from user input

    Any advice would be greatly appreciated.

    Thank you.

    PS I work with Photoshop CS5

    That's what I have so far.

    = Ruler with millimeters

    app.preferences.rulerUnits = Units.MM;

    var doc = app.activeDocument;

    var layer = doc.activeLayer;

    var dropdownlistArray = new Array(); / / the table of drop-down lists.

    var chosen_action = null;

    var ScreenShapeArray = new Array)

    "Round."

    "Elliptical".

    );

    var WinContent =

    "dialog box {------}.

    orientation: 'column ', \

    alignChildren: ['fill', 'top'],

    preferredSize: 300 (130) and \.

    text: "Export settings"------

    margins: 15,.

    \

    Coordinates: Panel {------}

    orientation: 'column ', \

    text: "Quarters of channels,"------

    margins: 15,.

    alignChildren: 'right ', \

    KChanelX: Group {------}

    St: StaticText {text: 'X:'}, \

    you: EditText {text: '15', characters: 4, justify: 'just'} \

    ST2: StaticText {text: 'mm'}, \

    } \

    KChanelY: Group {------}

    St: StaticText {text: 'Y'}, \

    you: EditText {text: ' 10', characters: 4, justify: 'just'} \

    ST2: StaticText {text: 'mm'}, \

    }\

    }\

    bottomGroup: Group {------}

    cancelButton: button {text: 'Cancel', properties: {name: 'Cancel'}, size: [120,24], alignment: ['right', 'Center']},

    applyButton: button {text: 'Apply', properties: {name: 'ok'}, size: [120,24], alignment: ['right', 'Center']},

    }\

    }"

    = Create object window

    var win = new Window (WinContent);

    = Display window

    Win.Show ();

    var X = parseInt (win. Coordinates.KChanelX.te.selection);

    var Y = parseInt (win. Coordinates.KChanelY.te.selection);

    alert (X); Here I get NaN

    alert (Y); Here I get NaN

    If (typeof (X) = 'undefined' | typeof (Y) = "undefined") {}

    Layer.translate (X + "mm", "-" + Y + "mm");

    } else {}

    Alert ("here"); Always end - up here regardles of canling or accept the default values

    };

    You don't have a selection in an edittext field. Like c.pfaffenbichler said - you get your X and your Y's

    var X = win.Coordinates.KChanelX.te.text;
    

    and so on:

    var X = parseInt(win.Coordinates.KChanelX.te.text); // or
    var X = Number(win.Coordinates.KChanelX.te.text);
    

    Have fun

  • vRA 6.2.0: started getting complaints from users of Firefox

    About a week or two ago, I started to get complaints from users that they saw errors and other oddities in the vRA.  For example, clicking on "Applications" tab that leads them to the 'Home' screen instead.  And errors like this:

    Internal error

    An internal error has occurred. If the problem persists, contact your system administrator.

    When you contact your system administrator, use this reference: 8dd728d5

    But if they use a different browser like Chrome, all right.  Does anyone know if a recent update of Firefox is now incompatible with vRA 6.2.0 cause?  Thank you.

    You can check your version of Firefox? 41 and superior update problems. Here is the link to the KB article

    VMware KB: Items in VMware vRealize Automation tab is inaccessible after updating FireFox to version 41.0

  • How to put a text from the user in the global chain

    I use the odbc interface to record the measurement result in an excel sheet.

    Now I need the ability to enter text in a separate column.

    This text is a free user input string.

    But I have not found a way to transfer a string from the input message to a global string module.

    Is there a way to do this?

    Concerning

    Andreas

    This is the solution.

    Thank you very much.

    (An example says more than thousand words)

    Concerning

    Andreas

  • Text entry mode and user input validation

    Hey guys, someone tried to implement some sort of validation entry on BB 10?

    According to the literature, we have TextField that can be assigned to one of the variants of TextFieldInputMode: URL, PhoneNumber, NumbersAndPunctuation etc.

    There are no examples of this feature in action in the examples of Cascades source code on GitHub.

    I tried almost all variants of documentation and that you do not notice any changes in the local keypad. It always shows all the characters with special keys for user able to grasp everything that he or she wants. I guess that's what we call 'Default' variant of the keyboard. It's not good for me. At least, I want to be able to transmit a user through the regular expression input and generate an alert if something is wrong with the supplied value. But it would be much better to limit user input to some variants of the keyboard (for ex, keypad only)

    Here is my code:
    TextField {}
    ID: iValue
    hintText: "enter your value.
    inputMode: TextFieldInputMode.URL / / change this to what you want - without changes
    bottomMargin: 50.0
    textStyle {base: SystemDefaults.TextStyles.BodyText}

    layoutProperties: {StackLayoutProperties}
    horizontalAlignment: HorizontalAlignment.Fill
    }
    }

    Is it possible to show only digital keyboard and, possibly, use a regexp validation of user input at the moment?

    Yes, this guy's it via textChanging() signal and a regular expression.

    See this post on - http://supportforums.blackberry.com/t5/Cascades-Development/Preventing-non-numeric-key-presses-in-a-...

  • Capture the names (or other user input)

    Salvation (new type of Captivate 4 here),

    How can I have a user enter their name and then re-use (e.g., show later in the presentation) using Captivate 4?

    With the help of a main entry text box allows me to enter the names, but then requires that this match against a list of 'correct' instead of enter simply what ever they want.

    Thank you

    Chris

    Hello

    It is possible with a user variable. Create a user variable, e.g. v_Name to store the result of the ETB. You can associate the result to the variable in the "Advanced" tab, the properties of the text entry box.

    If you want to reuse the name in the legend text, simply insert, using the 'X' key and an arrow pointing down. You will see $$ v_Name$ $, but when previewing or have fun with the CP-film the variable will be replaced by the name typed in the TEB.

    BTW: there is a tutorial very well in aid, advanced Actions of chapter and the Variables and it's workflow I described.

    Lilybiri

    PS: Disable "Validate user input" for the ETB (Options tab) to avoid the verification of entry

  • Text input does not pause for user input

    If all goes well, a simple question:

    Brief:
    I have a box of text on a page of simulation of connection that do not pause for user input. Instead, it just displays as if writing be typed and then continues.

    Question:
    How do I get this thing to pause and wait for the user to enter the login id?

    Detail:
    Version 1.01.1418 (full version), platform PC of Captivate
    Text entry box
    1 entry correct listed: "sa".
    Success = continue
    Display: Rest of slide
    Break after: 0.1 sec (varied this having any impact on a break for the entry)
    No transition

    DRM for advice.

    This must have been a dark note somewhere in the documentation:

    You can not interact with the page if preview you with play this slide (F3). The other preview modes to the text entry area work correctly.

  • Can be used as part of the regular expression user input data?

    Hello!!

    Yet another querry me... This time want to know is possible to use the chain of user input in the context of speech reqular for instant search... I am aiming to add the search functionality in my game... Where I m going to have several items available in the list... what I intend is to have a text box where I accept user input and instant search still a noob in AS3... so, if using RegExp my goal?

    Suggestions please...

    Thanks in advance...

    Yes - you can build a regular expression like this:

    new RegExp("bob", "gi");

  • How can I return the user input?

    Hey everybody, I tried to go back to user input. I mean, I don't have up here the code that provides a text field and a submit button which will take you to the next page. On this page, however, I want to what the user has entered on the previous page of printing. I posted my code so far below:

    < name of the form = "form1" method = "post" action = "" >
    < label for = "input" > < / label >
    < input type = "text" name = "input" id = "input" >
    < / make >
    < do action = "return.html" > < input name = "Submit" type = "submit" id = "button" value = "Send now" / > < / make >

    Yes, pretty basic but I did research on this for awhile and I can't find how to do anywhere. My back page is just blank because I don't know what I need for it. Any help would be appreciated, thanks!

    Just install a test server local like everyone who develops the way you're supposed to do. Use a remote server as a test server is certainly NOT the recommended way to test your developments! Inexperienced developers or those who don't know any better will use a remote test server. Don't do it! Use the professional and secure to set up a local test server method to test your developments locally before you upload to a remote server.

    Google local test server for more information.

  • As user input

    How can I generate a report based on the value of a textbox session... im using a similar, so I want to select a record where a column is defined as user input... What is the syntax for this selection...


    Thanks in advance

    Stefan

    Hello

    Assuming that the element is named P1_TEXT then:

    SELECT * FROM TBL WHERE COL LIKE '%' || :P1_TEXT || '%'
    

    Mike

  • Enter user input

    Good afternoon

    I am very new to JDeveloper and I'm having a problem with getting a keyboard user input. Everything compiles fine and when I run the program it comes up with the prompt saying "enter a number" in the window and I do not know where to enter a value. Where does this happen?

    Thank you

    Adam

    Published by: el duderino on March 17, 2009 14:00

    You need to give more information on the type of program. A program of J2SE or J2EE ADF BC/ADF Faces RC program for example?

    I suspect you mean a program of J2SE, trying to get the text from the user in the console, correct? Shay Shmeltzer's next post should help:

    http://blogs.Oracle.com/Shay/2008/02/21/#A663

    CM.

  • FCPX - captured live from a remote camera?

    Experience scientific, a little dangerous.  I have a Sony FS700 camera trained on experience.  I want to be able to run a USB cable from the camera to a control booth closed about 20 feet.  I want to be able to control the camera from a Macbook Pro.  I also wonder if there is a way to capture data that is ensuites directly into the computer (on an external hard drive) using the may output HDMI Cable? ... I remember that old Final Cut get live data from a camera.

    FCPX do something like that?

    Or maybe someone has a suggestion how it could be done?

    All ears,

    Ben

    FCP X cannot capture alive from a camera via USB. In fact, USB does not have the live video from the camera anyway, so no software can't.

    You can take the output of the camera, but you would need a HDMI input device. The HDMI on the MBP is for * output *, do not input.

    If you get a device like BlackMagic UltraStudio MiniRecorder, then you can use the BlackMagic software save and then import the resulting in FCP X film.

    PS: Really you run 10.6.8? What model is your MBP?

  • To the number of decimal places control user input

    Hey everybody,

    I am all new to LabVIEW and just learn how it works. I was wondering if there was a way to allow user input to change the number of decimal places (the output of my function is infinitely extensible).

    I tried, but it did not work:

    Using a digital input, I appended a string with "%" + '[INPUT]' + 'f' with the number of function concat strings and string functions. I used the resulting string as the formatting string in the value format function.

    This doesn't quite work. The output should be something like "28.274", but instead, it displays "283f. Anyone know why? Is there a better way to do it?

    In addition, attach a picture of the front panel and diagram of block for clarity.

    (Yes, it's homework, but the assignment does not include allowing the user to adjust the number of decimal places, it's just something I would like to add.)

    Get rid of the number 2 for the width of your decimal string number.  It requires a space before a number to a number.  %. 6F is not equal to % .6f.  The string format don't quite understand the first format string.

    (PS.  It helps if you attach your VI.  In this way we can play with what you have rather than trying to recreate it from scratch.)

  • FILTER (KB 911895) NO HIDDEN USER INPUT DATA.

    I have the new Sony Vaio Tower w/Windows 7 Home Edition - the only failed download is HID NON-USER INPUT FILTER DATA (KB 911895).  I read all of the previous answers, but no one says it's function or end? If we do not need then why was he sent us to download?

    See http://windows.microsoft.com/en-US/windows7/Windows-Update-error-80070103 [ignore the error number if necessary]

    HOW to hide an update or restore a hidden update
    http://www.SevenForums.com/tutorials/24376-Windows-Update-hide-restore-hidden-updates.html

    Tip: Get only driver updates you really need from the download page of the device manufacturer or the computer, not Windows Update.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

Maybe you are looking for

  • lost the possibility to open a link in Firefox

    Execution of T-bird 38.0.1 with Windows 7 Pro 64 bit. All of a sudden I lost the ability to click on a link and open a tab in Firefox. I tried to follow the instructions to get out of trouble, but among other things, the instructions are a little dat

  • Indicator light flashes yellow.

    The light - usually green and steady - hand flashes yellow. A Wi - fi connection is always connected.

  • lvproj have several files of dependencies

    Hi all I don't expect that a single highest file group dependencies, but there are three, can someone tell me how to move two of these files in the dependencies? Thank you very much!

  • Integrate the ICB with web interface

    Hi all We already have a CVI writes to order any of our instruments. We must develop a web interface to pass parameters to the CVI. In addition, currently the data is generated by the BCI as .csv files. What more we need to do is to transfer the data

  • Display fonts motorcycle G_Boxed

    Hi all I am owner of a motorcycle G 16 GB mobile. I have a problem in which the fonts in the mobile suddenly gets displayed as small boxes when I suddenly close an app and reopen it. Everyone knows about this problem? The new update will rectify this