Just add 2 numbers.

Adding 2 numbers 3 textfields with a button, I can do. The first textfield for one entry, the second for two input and the third for the output (result). The button of the operation.

recently, some of you have helped me with the calculation of the square root. As you can see below:

http://www.er.UQAM.ca/Nobel/m340201/test/newestcalc.html

My question now, how can I add 2 numbers only with a textfield (result) and 4 buttons. A button for the number 1, another for the number 2, one for the operator + and finally one for the = sign.

I have the code and being new to this I can't figure out how to put everything to work:

import flash.events.Event;
var txt_inp:TextField = new TextField();
txt_inp.Type = "input";
txt_inp.x = 168.95.
txt_inp.y = 51.10;
txt_inp. Width = 209;
txt_inp. Height = 52,90;
txt_inp. Border = true;
txt_inp. BorderColor = 0x0000da;

txt_inp. Restrict = "0-9";
var myFormat:TextFormat = new TextFormat();
myFormat.size = 44;//myFormat.align = TextFormatAlign.CENTER;
myFormat.align = TextFormatAlign.JUSTIFY;
txt_inp.defaultTextFormat = myFormat;
txt_inp. TextColor = 0x0000FF;


txt_inp.maxChars = 5;
txt_inp. Multiline = false;
txt_inp. Text = ";
addChild (txt_inp);

var num1:Number;
var num2:Number;

Button1.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler);
Button2.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler);


function fl_MouseClickHandler(e:MouseEvent):void
{
txt_inp. AppendText (e.currentTarget.Name.substr (6));
}

buttonplus.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_5);

function fl_MouseClickHandler_5(event:MouseEvent):void
{

trace ("mouse clicked");

}

equale.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler_6);

function fl_MouseClickHandler_6(event:MouseEvent):void
{

trace ("mouse clicked");

}

If you want the result to appear in the use of textfield:

the var sum: number;

var nA: Array = [];

stage.addEventListener (KeyboardEvent.KEY_DOWN, keyF);

function keyF(e:KeyboardEvent):void {}

48-57, 96-105

var n:int=e.keyCode%48;

If (n > = 0 & n)<=9)>

nA.push (n);

}

}

buttonplus.addEventListener (MouseEvent.CLICK, plusF);

function plusF(event:MouseEvent):void {}

sum = nA.pop ();

}

equale.addEventListener (MouseEvent.CLICK, equalF);

function equalF(event:MouseEvent):void {}

sum += nA.pop ();

txt_inp. Text = String (Sum);

}

Tags: Adobe Animate

Similar Questions

  • How to add page numbers

    How to add page numbers of my 10-page document that I just

    created? Is it possible for me to add the page numbers in the footer, as you do in MicroSoft Word?

    The problem is, I have already created my form & it cannot re - organize everything. If I coul

    d enter manually the page number that would be perfect for... I just need to be in the footer box. Can anyone help?

    Master page is as a header / footer sections in the normal application of MS Word. Master page will be common for all pages in the application.

    Please see the attachment for how to identify the master page and adding the page numbering.

    Niall said to place the custom control to the footer on the master page, either in the center / right based on your design.

    Thank you

    Srini

  • In the search box at top right, how do I change from Google to Google.co.uk. Or, just add Google.co.uk

    In the search box at top right, how do I change from Google.com to Google.co.uk. Or, how I just add Google.co.uk to the list

    You can go to the next page and choose the one you want to add; probably one of the elements of #11. Main engines:

    http://mycroft.mozdev.org/search-engines.html?name=Google.co.UK

    See:

  • How can I add page numbers to PDF in Adobe Reader ms?

    I'm used to be able to add page numbers to PDF with an older version of the player. How can I do that in DC?

    Hi elizabethc54956057,

    It is not possible to add page numbers to PDF with Adobe Reader.

    You may use the software Adobe Acrobat for the same thing.

    Reference: https://helpx.adobe.com/acrobat/using/add-headers-footers-pdfs.html

    Hope that helps.

    Kind regards

    Ana Maria

  • How to add page numbers to a file adobe ive been sent

    How to add page numbers to a file adobe ive been sent

    If you have Adobe Acrobat Reader, it can be done. It can be done with the full version of Acrobat.

  • Can Adobe Pro automatically add the numbers of files?

    In our hospital, we went from Nuance PDF Pro to Adobe Acrobat IX.  The largest surface that we cannot defeat is defining the Adobe as our default printer and sequencing automatically files.  In the PDF of Nuance (DocuCom and ScanSoft) printer drivers, we have been able to change the properties to automatically add flight numbers.  We spent many hours with our support technical (we are a huge institution in many States and countries) and they do not have a solution.  We travel options, is there a way for Adobe Acrobat Pro, put on the numbers that we run PDF print multiple files?  We have not found anything in the literature or by trial and error.

    I assume you mean the creation of PDFs by printing to the Adobe PDF, PostScript printer driver instance, correct?

    If Yes, this instance of printer driver creates a default file to PDF on the base name of the %% Title line comment placed in the PostScript file by the Windows PostScript driver. You can of course change this to what you want in the dialog box file presented to you for the location for the placement of the PDF file.

    What being doesn't say, there is no possibility of embedding to create numbers end automatic or in the case of duplicate file names, either unconditionally.

    If you have an application of your own which is printing with the PostScript driver, programmatically, you can probably force a new name with continuously moving numbers when calling GDI to start the printing process.

    -Dov

  • I have creative cloud for photographers - Lightroom &amp; Photoshop.  I want to add this membership to my laptop.  When I downloaded creative cloud to my laptop, she wants to give me a 30 day trial.  How do I just add to my current subscription?

    I have creative cloud for photographers - Lightroom & Photoshop.  I want to add this membership to my laptop.  When I downloaded creative cloud to my laptop, she wants to give me a 30 day trial.  How do I just add to my current subscription?

    You simply need to connect through the CC desktop application, then install applications through it.

    https://helpx.Adobe.com/creative-cloud/help/creative-cloud-desktop.html

    Cloud creation help / sign out, sign in | Creative office cloud app

    http://helpx.Adobe.com/creative-cloud/KB/sign-in-out-creative-cloud-desktop-app.html

  • How can I add page numbers to PDF?

    I combined multiple files into a PDF file.  How can I add my combined document page numbers?

    Hi Patti-IWFNorCal,

    It cannot be executed via the service to create a PDF file once you have created the PDF file.

    You can effortlessly add page numbers in the PDF document in Acrobat.

    1. Tools - Pages - Edit Page Design - Header & Footer - add header & footer.

    2. Select the font and size, etc., place the cursor on the appropriate site to insert the page number, click on the button "Insert Page number" and click OK.

    Kind regards

    Florence

  • Can I add page numbers to the entire document once I have the combine in pdf format?

    Can I add page numbers to the entire pdf document when combined?

    Hi gjanowiec,

    You can add page numbers to PDF using Acrobat. See https://acrobatusers.com/tutorials/how-do-i-add-page-numbers-at-the-bottom-of-my-pages for more information. If you do not have Acrobat, we invite you to try free for 30 days (www.adobe.com/products/acrobat.html).

    Please let us know if you have any additional questions.

    Best,

    Sara

  • What product Adobe do I need to add page numbers to an existing PDF?

    What product Adobe do I need to add page numbers to an existing PDF?

    I agree with Adobe PDF Pack.  This provides me with what I need?

    Hi questioner_00001,

    To edit a PDF file, such as adding page numbers, you need Acrobat. PDF Pack does not offer this feature. You can try Acrobat free for 30 days if you wish. For more information, see www.adobe.com/products/acrobat.html.

    Best,

    Sara

  • increase of 16 concerts in 32 - need to replace with a 32G 16 G - or just add an another 16G?

    Because we always want to have the max - if you want to upgrade to 32Gigs (map of US $)-you can just add another 16 Gig, or must remove it and replace it with a 32Gig?

    I realize it kind of looks like it has a slot for an additional 16g but I don't think that there is really an outlet for him.

    You will need to buy a 32g and copy the 16 g to it.

  • do not add sequential numbers when recording software

    Just got the 8630 all-in-in-one. The scanning software explains that sequence numbers will be added when scanning, but this does not happen. I wonder to save every file scanned as "scan" and I have to add numbers myself (big headache). I checked the settings, and I don't see what I'm missing.

    Hello

    Try following my post below, I think tht should help:

    http://h30434.www3.HP.com/T5/scanning-faxing-and-copying/HP-OfficeJet-6600/m-p/3948148/highlight/true#M91988

    Shlomi

  • Add two numbers

    I have a table with two columns:

    colA, colB
    -----------------------
    1 2012
    2 2012
    12 2011
    11 2011


    The two columns are numbers, however, colA stores year-round and colum B the month
    Now, I want to add these love:
    1st row should translate 201201
    2nd should translate 201202
    in 201112 3rd & 4th in 201111... How could I do that? simple add the two columns is not the solution, because the first row would result in 20121.
    Pls advice!

    You could do something like

    colA * 100 + colB
    

    Store date values (or parts of date values) in the separate numeric columns and then try to date arithmetic on these numerical values are almost always a mistake. Why you store the data in this way in the first place? Why don't we just save the data as a date?

    Justin

  • Add two numbers without the use of variables?

    Hi, I have yet another simple problem that I tried to solve 10 different ways, and nothing works. I am trying to add up the numbers of two text entry fields when the user presses the left arrow key on the keyboard. I try to avoid typing just the names in the boxes of Var formatting text fields are slightly different. Here is my current code, I have attached to the button:

    on {(keyPress '< Left >')
    var WagerA = int (_root. AWager.text);
    var moderateto = int (_root. Ascore.Text);
    WagerA + moderateto;

    }

    Try to use...

    var keyListener:Object = new Object();
    Key.addListener (keyListener);

    keyListener.onKeyUp = function() {}
    If (Key.GetCode () == Key.LEFT) {}
    trace ("left"); use for testing

    Insert your code here
    }
    }

    Copy the following code will work for the left key, which will demonstrate the trace.  If it does not cover your data of textfield, then the problem is most likely with the textfields

  • I want to know how to stop adds irretating me just a click, I get 5 page just add that I can't navigate freel, I feel really irritate

    I use Windows 7 and fire fox 29, but I'm really not happy because when I try to open the page I make more page 5 and adds suddenly comes first and it take time narrow but immediately made it again once I can't really just browse freely I feel bad really the best done better Explorer , but not explore you isn't allows way adds but how you crome and Opera which adds more than just Center page corner page last page you have the chance get price myatas and adds much that irritates me I can't brouse freely same thing also requist crome and Opera also please help stop adds unnesary just means
    When I tried to open a page, but I'm opening another page is very bad feeling and open another page I was date it give me more money unnesary data access provider please help me solvue this problem which is very big problem for me

    Sometimes a problem with Firefox can be a result of malware installed on your computer, you may not be aware of.

    You can try these free programs to search for malicious software that work with your existing anti-virus software:

    Microsoft Security Essentials is a good permanent antivirus for Windows 7/Vista/XP, if you do not already have one.

    More information can be found in the article troubleshooting Firefox problems caused by malware .

    This solve your problems? Please report to us!

Maybe you are looking for