AS3 increase and decrease operators

I use AS3 on the timeline. I'm working on a multiplication game. The idea is to count the number of correct and incorrect responses, and give the user a final account.

I have several dynamic text boxes:

Box1 and box2 will multiply them.
Box3 = area of seizure; respond to user input
Box 4 = message displays
box5 = correct1; Displays correct number
Box6 = correct2; Displays the incorrect account

buttons
bt_1 = controls responses
bt_2 = reset problems

PROBLEM:
I CAN'T GET BOX6 COUNT INCORRECT ANSWERS. HOW CAN I SOLVE THIS PROBLEM?


Here is my code:


rN: random number

var i: uint = 0;

var rN:int = Math.round (Math.random () * 2);


Box1.Text = String (1 + Math.ceil (5 * rN)); adding 1 to the ceiling produces an integer between 2 and 6

rN = Math.random ();

Box2.Text = String (1 + Math.ceil (5 * rN));

Box3.text =""; This is the text of entry where the answer will be registered.
box4. Text = ""; This is the message, or not.

internship. Focus = Box3;
box4.setSelection (0.3);


check the button answer
bt_1.addEventListener (MouseEvent.CLICK, reviewAnswer);
function reviewAnswer(event:MouseEvent): void
{
checkAnswer();
bt_1.visible = false;
bt_2.Visible = true;
}


function checkAnswer(): void
{
var r1:Number = int (box1.text); R1 is the number of box1.
var r2:Number = int (box2.text); / / r2 represents the number of box2.
var r3:Number = int (box3.text); / / r3 represents the value in box
var r4:Number = int (correct1.text); / / r4 represents the value in the correct area
var r5:Number = int (correct2.text); / / r5 represents the value of the incorrect answer of box
Box1.text ="";
Box2.text ="";
Box3.text ="";

If ((r1*r2) == r3)
{box4.text = "Yes";
++ i ;
correct1. Text = String (i);

}
If ((r1*r2)! = r3) {}
box4. Text = "No";
--i ;
correct2. Text = String (i);

}
}

another button problem
bt_2.addEventListener (MouseEvent.CLICK, anotherProblem);
function anotherProblem(event:MouseEvent): void
{
Box1.Text = String (1 + Math.ceil (5 * rN)); adding 1 to the ceiling produces an integer between 2 and 6
rN = Math.random ();
Box2.Text = String (1 + Math.ceil (5 * rN));
bt_1.Visible = true;
bt_2.visible = false;
box4. Text ="";

}

Thanks for your help.

German

you are granting correct2 I be that looks at the number of correct answers.  do a count separated from wrong answers of I inferred from the sum to retrieve the number of incorrect answers.

Tags: Adobe Animate

Similar Questions

  • Laptop brightness is increasing and decreasing of its own, gel Touchpad...

    Hello

    I bought my phone yesterday and found that its brightness is increasing and decreasing of hers... it is not even always...

    His problem with displaying his looks...

    Touchpad freezes also on several occasion... very annoying sound...

    Please such the solution else I will return the laptop... I don't want to keep the defective part with me...

    Hello:

    I will not be able to help you with why the touchpad does not work.  Maybe it's a defect.

    Have you installed the latest driver of pad touch support page for your laptop?

    Any laptop you buy that comes with W8.1, you can have the screen brightening and the thing was dimming.

    This is because there is a new setting in Windows 8.1 called Adaptive brightness.

    If you find it boring (what seems do you), you can easily disable the Adaptive brightness adjustment.

    Please see this link for information on where to access this setting.

    http://www.eightforums.com/tutorials/6042-Adaptive-brightness-turn-off-Windows-8-a.html

  • 15 - ac026tx: screen brightness increases and decreases automatically permanently

    I just bought my phone 10 days ago and I am facing this problem.

    Sometimes when I work with my laptop suddenly the brightness of the screen begin to change automatically

    as a decrease and an increase and then all of a sudden for about 5 seconds and comes to normal

    I can't find the reason behind it.

    Hello:

    W8.1 comes with a power of Adaptive brightness setting in the section of the control panel power options.

    If you have not disabled this setting, see turn off solved the problem.

    Please see this link for where is this setting.

    http://www.eightforums.com/tutorials/6042-Adaptive-brightness-turn-off-Windows-8-a.html

  • T420s - screen brightness increases and decreases

    Hello

    I noticed on my T420s that changes of screen brightness according to the image on the screen.

    For example:

    -I'm looking at some site with black background and gray letters

    When I pass screen for my outlook or for example firefox with this forum which first minutes white white background is gray and then it becomes whiter and whiter until after about 2 seconds, he moved.

    I thought at first my eyes question, but it is certainly behavior from my laptop.

    Anyone with the same problem? Can do this set by some software/Power Manager tweak?

    Do you use your laptop on battery when this happens?

    It is a setting I believe you can disable in the Intel graphics settings. Mine does the same thing - it's supposed to save energy.

  • Increase and decrease speed

    Could someone tell me how to speed up a clip and then slow down again in the same clip without an editing tool. Is this something that needs to be done in After Effects or can do you in the body with keyframing?

    Is there an autour tutorial which shows how this is done?

    Thanks for your help.

    http://www.mediacollege.com/Adobe/Premiere/Pro/time-remapping/

  • How to increase or decrease the effect of an adjustment brush in Lightroom CC? In Lightroom 5, I could hover over the PIN and drag the two-way arrow left or right. This feature seems to have disappeared in the CC version.

    How to increase or decrease the effect of an adjustment brush in Lightroom CC? In Lightroom 5, I could hover over the PIN and drag the two-way arrow left or right. This feature seems to have disappeared in the CC version.

    I'll answer one of your three messages that asked this question.  If possible, please remove the other two.

    Hover and dragging moves the axis as it should.  The cursor turns into a hand to indicate the area brushed, it moves.

    Hover over the pin code, press the Alt/Opt key and drag left and right and the effect will become less and more.   The cursor turns into a two-headed arrow to indicate that the function of the drag has changed.  If you are not hovering over a pin code and press the Alt/Opt, then the cursor turns into a brush to erase to remove the adjustment every time you paint.

  • Creation of formula help: how to find the percentage of increase or decrease

    Hello community,

    I am trying to create a formula that will find the percentage increase or decrease in sales from one year to another. For example, cell B1 is my sales for 2014. C1 represents my sales for 2015. How can I write the formula in D1 to find the percentage increase or decrease of sales between 2014 and 2015?

    Thanks in advance!

    You can try this:

    The formula in D1: = C1/B1−1

    Then set the Data Format of D1 to percentage:

    SG

  • How to create a digital control (of any type) which can be increased or decreased by a 'unit' at the same time?

    As in the title.  I want to create a digital control (no current limitation on its type) with a range of 1 to 10 (and a step of 1).  The only difficulty that I have, is that the user should only be able to increase or decrease 1 at any time.  Code initiated by this change of value must have completed at least once before that the value can be changed again.  This is because code of VI is mainly contained in a while loop and control are read once at each iteration and its last value should not differ more than 1.

    Is this possible with LabVIEW 6.1 and if so, how?

    One of the solutions that I came up with so far is to disable the control immediately after its reading, and to turn it on again immediately seized is read the next time (I have to assume that the user is unable to click twice before the control is disabled).  It is an acceptable method, or is there a better way?

    I also had an idea of partially disable a normal digital control, such that it could not be typed in - only arrows remained operational.  However, I'm not sure how.

    James

    Hi James,

    You can use the two buttons (by releasing latch) and a digital display that shows the current value. Button increased the value and the other decreases. Store the value in a shiftregister to work with her.

    I don't know if your solution would work because use may directly enter the new value.

    It will be useful.

    Mike

  • HP ac024 tx: can not increase or decrease the brightness

    Hi, I installed Win 7 64 bit on my computer. Im not able to see the options to increase or decrease the brightness on my PC. Please help me with this, the question seems low, but could do nothing. I installed all the drivers available, but cannot find the display drivers for my model. I tried some google steps for... anything!

    Arungraj22 wrote:

    ... question seems small, but could do nothing. I installed all the drivers available, but cannot find the display drivers for my model...

    Hello

    Your machine came with FreeDOS, this question is not small:

    http://support.HP.com/SI-en/document/c04746482

    It uses Intel HD Graphics 4400. All the drivers for this machine should be on the following link:

    http://support.HP.com/in-en/drivers/selfservice/HP-15-notebook-PC-series/7771404/model/8326082

    Your machine needs a driver Intel graphics high definition (HD).

    You must install the Driver and Intel Chipset Installation Utility and driver Intel Management Engine Interface (MEI) and restart the machine first.

    After all this, you need the following driver to use the keyboard shortcut:

    http://h20564.www2.HP.com/hpsc/SWD/public/detail?swItemId=ob_129672_1

    Kind regards.

  • Re: Satellite C660 - after cooler BIOS update speed is increased and troubling

    Good evening
    Five hours ago, I did update the BIOS and restart the computer after that I noticed that the speed of the cooler is increased and worrying. Mention that they bought a Toshiba Satellite C660 last month.
    Please, if you can help me how to set the correct rotation!

    Thank you!

    PS: Sorry for my English I'm not from England!

    I think several people have posted about it here on this forum so it's a shame you don't l l check this forum before you took the decision to put the BIOS updated. If you have some time check other assignments in category C satellite.

    In any case, I can say, it's that you can try to reduce the speed of the cooling fan with cooling method option in the advanced power settings.

    This should reduce the speed of the cooling fan and your laptop will work a lot quieter. Put simply to option in battery mode.

  • Dear all, can __How I increase and expand the volume of my hard 22nd of the available capacity at the (:)) d hard drive)

    Dear all,

    How can I increase and expand the volume of my hard capacity available to the (d) 22nd

    Hard drive

    You can't take a little D: and nail it on C:

    You delete D: > and then extend C: into the now unallocated space that will become D:.

    Save all data on D:, as it will be lost.

    http://www.Vistax64.com/tutorials/95418-disk-management-delete-extend.html

    How to remove and extend a Partition with Vista disk management

    See you soon.

    Mick Murphy - Microsoft partner

  • I am trying to remove users from my team and decrease the number of licenses that I pay. Many places tell me how to buy more, but I can't find anywhere to remove licenses to reduce my costs. Where should I look?

    I am trying to remove users from my team and decrease the number of licenses that I pay. Many places tell me how to buy more, but I can't find anywhere to remove licenses to reduce my costs. Where should I look?

    Manage your account http://forums.adobe.com/thread/1460939?tstart=0 team can help

    or

    contact Adobe staff to help
    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)

    Creative cloud support (all creative cloud customer service problems)
    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

  • I downloaded an upgrade to my adobe reader today, and since my search engine yahoo has increased and will not change to google. I have a macbook pro, help please? Anyone know how I can change this back? I tried through my settings but it

    I downloaded an upgrade to my adobe reader today, and since my search engine yahoo has increased and will not change to google. I have a macbook pro, help please? Anyone know how I can change this back? I tried through my settings but it does not work

    Hi Iférouane,

    If you are using Safari as a web browser: -.

    • Open Safari, go to the Safari menu > Preferences > General and set Google as homepage. Then, choose Google as your default search engine.

    If you use Google Chrome as the web browser: -.

    • Open Google Chrome.
    • In the upper right corner of the page, click on the Chrome Chrome menu > settings.
    • In the 'Search' section, select Google from the menu drop down.

    Let me know if you are still having a problem.

    Kind regards

    Nicos

  • Brightness increases (fn + f10) and decrease (fn + f9) does not not on my G1 450 Probook

    Hi, my hp proobook 450 G1 brightness increased (fn + f10) and reduction (fn + f9) suddenly stopped working yesterday.
    But I cannot change sound using the
    [fn + f6] key and [fn + f7]

    I also have a problem on my left button (button left control). My up, down, right button works fine, but left button works as RET.
    What can I do now?
    someone help me please for this.
    Thanks in advance

    Anoy121 wrote:
    Hi, my hp proobook 450 G1 brightness increased (fn + f10) and reduction (fn + f9) suddenly stopped working yesterday.
    But I cannot change sound using the
    [fn + f6] key and [fn + f7]

    I also have a problem on my left button (button left control). My up, down, right button works fine, but left button works as RET.
    What can I do now?
    someone help me please for this.
    Thanks in advance

    450 G1 (fn + f10) brightness increase & decrease (fn + f9) suddenly stopped working yesterday. Check in the BIOS to see how the action key option is fixed to operate.

    "I also have a problem on my left button (button left control)." My up, down, right button works fine, but left button works as a backspace " This is a normal mode of operation for that particular key .

  • How can I increase the size of location box and decrease the size of search box? The location was smaller and more small while the search box took the reports.

    The location box is so short, I don't see the url I type in, for example "yahoo.com" while the search box is so long that I can type a whole sentence in

    Place the mouse pointer between the address bar and the search bar, and it will become an icon of resizing that you can drag to the right or left to adjust the relative size of the two bars.

Maybe you are looking for