Problem with entering text button

I am an educator and I design an interactive activity for my students. I created two buttons named baby_B and baby_G and an input textfield called in_Text.  When a student presses baby_B, the letter 'B' is entered in the text entry field; If a student based on baby_G, the letter 'G' is entered in the text entry field. More than one entry of letter is acceptable as a student response: for exmple the BBB, BGB entry in the entry field is correct.  I have no trouble to write AS3 for this task, however:

For the solution of the student in the field of text to be correct, it must contain values such as the BBB, GGG, BGB and GBG in any order. I created an array named solution_S with these values. I also have an entry the solution button named enter_btn. The student can check their solution by pressing the enter_btn button; If the textfield of entry is correct, the quiz going on to the next image my scenario; If it is incorrect, it moves to a different image in my calendar. How would enter this actionscript to achieve? Thank you very much!

I entered the following code, but my animation plays up until this point, he then Trac for a second then slow down; He did this in a continuous loop. Any help! Thank you.

Stop();

baby_B.addEventListener (MouseEvent.CLICK, letterB);

function letterB(event:MouseEvent)

{

in_text.appendText ('B');

}

baby_G.addEventListener (MouseEvent.CLICK, letterG);

function letterG(event:MouseEvent)

{

in_text.appendText ("G");

}

enter_btn.addEventListener (MouseEvent.CLICK, check);

function check(event:MouseEvent):void {}

var solution_S:Array = ["BBB", "BBG", "BGB", "BGG", "GBB", 'GBG', "GGB", "GGG"];

var check: Boolean = false;

for (var i: uint = 0; i < solution_S.length; i ++)

            {

if (solution_S [i] m:System.NET.SocketAddress.ToString () == in_text. text)

                        {

                                    check = true;}

            }

}

If (Check)

{

gotoAndStop (61);

            }

on the other

{

gotoAndStop (62);

}

These are the following errors I get:

Scene 1, Layer 'action', frame 60, line 21

1119: access of property may be undefined text through a reference with static type fl.controls:TextInput.

Scene 1, Layer 'action', frame 60, line 26

WARNING: 3553: function value used when the Boolean type was expected. Maybe the parentheses () are missing after this function reference.

The first error is using 'Text' where 'text' is required... in_text. text

The second error is not clear, but can be set with the untangle the first.  You can simplify the control function by using the indexOf() method...

function check(event:MouseEvent):void {}

var solution_S:Array is ["BBB", "BBG", "BGB", "BGG", "GBB", 'GBG', "GGB", "GGG"];.

If (solution_S.IndexOf (in_text. (Text) > = 0) {}

gotoAndStop (61);

} else {}

gotoAndStop (62);

}

}

Tags: Adobe Animate

Similar Questions

  • I have problems with the text... Help

    Hey

    I have problems with the text box in indesign cs4...

    When I do a text frame and write a short text and want to make a new line and press ENTER, my cursor goes to the next page and the small red cross in the corner of my document apears.

    someone knows what to do here?

    I realle need your help

    Thank you

    This has been covered a lot. A BIOS update may be an option to solve the problem of keyboard mapping, you can change your keyboard shortcuts to reassign the digital keypad input to be a paragraph return or you can try simply by changing the State of the numlock - if it is on, turn it off and vice versa. Withthis problem most of the systems that seems to change the function of the two keys back and forth between the enter alpha and entry number.

  • I have a problem with entering my site of creative work on kodakgallery.ca.

    Original title: kodak software

    I have a problem with enter in my site of creative work on kodakgallery.ca can I enter everything on kodak but creative projects. Kodak contacted, they tried with no. results I have defraged my computer and cleaned but back to the same problem as soon as I touch the creativity he plans tell the parser error or does not not in the entity can help them.

    Hello

    1. are you referring to a Workflow for creating the InSite to Kodak?

    2. are you referring to the web request?

    Method 1:  Try to perform the clean boot and check if it helps, here is the link:

    http://support.Microsoft.com/kb/929135

    Note: When you're done to diagnose, follow step 7 in the article to start on normal startup.

    Method 2:  Download and install Internet Explorer 8, and check if it helps:

    Here is the link to download: http://www.microsoft.com/download/en/details.aspx?id=43

     

    If the problem persists, contact Kodak for known problems.

    Here is the link: http://kodakgallery.hivelive.com/hives/35bec54339/summary

  • Photoshop: problem with the text tool

    Hi there, problems with my text in Photoshop tool. When I try to write, using vertical text is written just a line, a straight line instead of any text. This only started happening in the last hours. I tried to change the texts and closing and start Photoshop again, all without success, please help?

    Please reset the text tool

  • Problem with the text is pixelated

    Problem with the text is pixelated on iPad retina. You have a solution?

    Digital Publishing Suite 101: keep the text accurate in a Raster slideshow

  • problems with the text and rounded rectangles

    So I have some rounding of the rectangles in fireworks, then export as fxg, and import it into flash catalyst - but they lose the roundness of rectangles square become. Also have problems with the text as half displaying or doesn't appear do not at all.

    feature request

    -would be really cool to be able to change the paths in flash catalyst

    -Edit the code in code view

    see you soon

    brand

    Hi, the absence of a property of corner radius is a limitation of the FXG export command in Fireworks CS4. We work closely with the Fireworks team to improve interoperability FXG in CS5.

    Thank you for your comments and suggestions.

    -brian

    Team Flash Catalyst

  • Problems with reset toggle buttons that show/hide captions

    I have a problem with the buttons toggle that I use to show/hide a number of legends about a single slide of the reset. The rocker works very well on the first button when I click on and off to show or hide a legend. A simple click on and watch legend. One click off the coast and the legend disappears. However, if I leave a legend that is displayed and click on other buttons to show/hide the other legends, they do not show or hide in a single click. They require two clicks. It seems that something continues the read head after that first toggle is used until there is a second click. The same thing happens if I reset to enter action. If I click on a caption and leave it in place and move to another slide, it disappears when I re - get this initial slide. However, it requires two clicks, not one alone, to display the legend. I find it very strange; I learned most of my techniques from the Lilybiri blog, but this problem does not occur on his examples. I think I'm missing something obvious, but may not know what it is. Any help is very appreciated.

    if_aa.jpg

    else_aa.jpg

    reset_aa.jpg

    Yes, I use Cp6. What I wanted to say about re-use, is that I have different scenarios where a similar script could be used, if your suggestion of a model is a good. My original intention was to write it in a txt for reference. Thank you very much for all your suggestions and links. I'll keep you posted.

  • I have a problem with the dynamic buttons on AC3.

    I downloaded a flash with a pre-made navigation model and all the buttons are in English. I am really struggling to do the buttons display Cyrillic text. Whenever I write in Cyrillic text, buttons are empty. Here is the code:

    var menu_label:Array = new Array ("Something",

    'Something',

    'Something',

    'Something',

    'Something');

    var total: Number = menu_label.length;

    var i: Number = 0;

    var: page number;

    var main_menu:MovieClip = new MovieClip();

    stage.addChild (main_menu);

    for (i = 0; i < total; i ++)

    {

    btn var = new flashmo_button();

    btn.name = "btn" + i;

    btn.x = fm_button.x + i * (fm_button.width + 5);

    btn.y = fm_button.y;

    btn.buttonMode = true;

    btn.item_no = i;

    btn.flashmo_click_area.addEventListener (Event.ENTER_FRAME, btn_enter);

    var each_substring:Array = menu_label [i].split("|");

    btn.flashmo_button_label.fm_label.text = each_substring [0];

    btn.item_url = each_substring [1];

    main_menu.addChild (btn);

    }

    Any ideas how to solve this problem? Thanks in advance!

    PS: I am a complete newbie

    Try to join the police in the textfields.  If you select the textfield object in the button, theProperties Panel should have a button available called Embed.  Click on that and rthen select the characters that you expect, you'll need (the less the better in terms of file size)

  • Weird problem with dynamic text

    Hello

    I created a dynamic text field - mediaImportName001 (created and it contains the name of a file that I have chosen to import them using a browser (as3 and AIR) button.)

    It works very well - I can import the file, and the name appears in the field.

    I would now like to pass the content of the text field to another text field.  But I'm not content. If I try to find the contents of the textField trace("mediaImportName"+thisNum).text - Flash returns "undefined" (even though I'm him asking to draw once the field has been filled).

    I use the following code to check that the material is really there and named correctly (the code returns the children):

    for (var i: uint = 0; i < this.numChildren; i ++) {}
    trace (this.getChildAt (i) .name + "\t type:" + typeof (this.getChildAt (i)) + "\t" + this.getChildAt (i));
    }

    It returns:

    object: type instance370 [object, form]
    object: type mediaImportName001 [TextField object]
    object: type mediaFiletype001 [TextField object]

    How can I get Flash to give me the text in mediaImportName001?

    It's weird - this.getChildAt (i) .name

    from above gives me...

    mediaImportName001,

    yet

    trace (['mediaImportName' + thisNum] .name);

    returns undefined (thisNum represents an increment I used to name several clips and text fields and in this case trace (thisNum); return 001)

    Any ideas why this happens?

    Thank you

    Shaun

    No logic problem, just a problem with describing the problem (as far as the fix goes) and using the property name (as far as the issue goes).  There is a difference between the creation of a dynamic textfield (a type of textfield) and dynamically a textfield (using code to create).

    In AS3, the name property is a property and it is not the same as the name of the instance that you can assign to an object on the stage.  To target an object using its name property, you must use the getChildByName() method, or alternatively, you can use the variable you used to create it.  You may need to cast as a TextField object as well as to operate...

    trace (TextField (this.getChildByName ("mediaImportName" + thisNum)). (Text);

    which would produce the same result as the use of...

    trace (mediaImportName.Text);

    I don't know how the numbering disperses on "001", but you might find it easier to work with by storing just the instances of an Array by using the media_file_num to set the index where they get.  Then, you would be able to target the textfield to help...

    trace (tfArray [thisNum]. (Text);

  • Problem with the text tool.

    Hello

    I'm having trouble with the text tool in pse 8.

    When I type and I get to where I want to start a new line of text and press the Enter key, instead of starting a new line under the rest of the text as it is supposed to and always, before starting the new line of text directly on top of the text line previous. When I continue typing just starts the line of text overlapping. It's really annoying and I have no idea how to fix! It was working fine earlier today.

    I hope someone knows how to solve this problem.

    -Josh

    Try to reset the text tool by clicking on the small facing down

    arrow on the far left of the tool options bar and choose

    Reset tool.

    MTSTUNER

  • Problem with the text to Speech Dictionary Editor

    I do a series of projects of Cp4 using the synthesized voice (I use Paul, if it matters). I recently discovered the dictionary Editor (UserDicEng.exe). I use fixed from this page of the Captivate Blog:

    http://blogs.Adobe.com/Captivate/2009/07/text-to-speech_-_user_dictiona.html

    I can create pronunciations customized in the editor, but I can't make them work in my projects, even after changing the line of text, pressing on convert button and replacing the audio in the slide.

    In my case, I am customizing is the pronunciation of a URL, forcing Cp to read, for example, " " http://CNN.com "as" http colon slash slash cnn dot com "." Even after customization of the pronunciation, it reads "http cnn dot com". I can, of course, write phonetically in the slide notes, but I wish that these double as closed captioning, so it's a less-than-ideal solution.

    I have a similar problem with Paul.  I found that if I use Kate instead of Paul and change Kate dictionary, she did a better job.  In fact, I found that the Kate and Paul seem to use dictionary of Kate.  So, I do all my editing in the dictionary of Kate.

    I submitted a bug on this, plus I had business service Adobe customer on this issue since last September.  Still no resolution.

    I hope this helps.

    Mister C.

  • Problems with the sound button and the wireless button

    I have a computer laptop dv6-2155dx, and he has a problem with the sound, the button bar button and the wireless button, all of them continue to work, I do not know if I made a mistake and let them turn off or there is another way to get available.

    I need some advice.

    Hello

    Do a hard reset:

    1 disconnect all devices and remove all USB devices and multimedia cards.

    2 disconnect the power adapter, remove the battery and then press in and hold the button for at least 1 minute.

    3 reconnect the power adapter (do not connect the battery), press the power button

    Verification is your problem is resolved or not.

  • I have a problem with Windows 8 buttons.

    Original title: problems of Windows 8!

    I recently had a problem with most of the buttons. It seems that since I installed a new font, I seem to get white buttons in the application Mail and this http://i.imgur.com/OE6rRxh.jpg?1 around elsewhere.

    Thank you to everyone who tries to help him, but if someone can give me the [s] name of the police [s] that are normally used in Windows 8. I think if I re - install the font or fonts for Windows, it will start working again.

    I recently had a problem with most of the buttons. It seems that since I installed a new font, I seem to get white buttons in the application Mail and this http://i.imgur.com/OE6rRxh.jpg?1 around elsewhere.

    Thank you to everyone who tries to help him, but if someone can give me the [s] name of the police [s] that are normally used in Windows 8. I think if I re - install the font or fonts for Windows, it will start working again.

    Hello

    Those who are not traditional icons they are symbols that belong to the Segoe UI police.

    See the following Web site for an excellent tutorial to solve this problem.

    [SOLVED] Unknown character or vertical Rectangles are appearing in place of metro icons in the Windows 8 start screen and login screen - tweaking with Vishal:

    http://www.askvg.com/fix-unknown-characters-or-vertical-rectangles-are-showing-in-place-of-Metro-icons-in-Windows-8-start-screen-and-login-screen/

    Let us know if it works for you.

    Concerning

  • Problem with the text block (text cut)

    Hello

    I have a problem with indesign (last CC version, I have upgradate today in the morning).

    I create a document with several pages and each page

    is a text box it and the text box are connected (the text content is broadcast through them).

    The text box are defined by a paragraph style, where I set the font style, color...

    I defined that the box can be 2 colunms and oviously, I also set betwin space columns.

    So the apears tex cut in the bottom text box and the rest of the blanks strages.

    I enclose a scrrenshot.

    Please, help me, I'm stacked in this disorder.

    Thnk

    EmilianoSchermata 2016-07-21 alle 16.48.59.png

    I find the solution.

    Yhe problem was in the style Panel,

    in the tab which, in Italian, is called 'options di separazione.

    I am enclosing a copy.

    Thank you all

  • Problems with the 'Text Ticker' Widget

    Hello, I have a problem with the widget "Ticker text." I tried to put more ticker and then a text on my site, but it does not work, when I look in Muse it looks like this:

    TextTickerinMuse.JPG

    and when I look in the preview only the first text ticker works... maybe it is not possible to have more then ticker text on a site?

    TextTicker.JPG

    Thank you.

    It seems that you use the same name for all instances of ticker on the page.

    You must have a unique name for each ticker you want on a single page. Strips with duplicate names will not work.

    See you soon,.

    Vikas

Maybe you are looking for