AS3 score increases only 7 times. then it goes to zero. strange!

Flash as3, I noticed several times score increases by 7 times. can I get score 7 * 5 = 35, but when he reached 8 movieclip the score should be 40, but it goes to 0.

I noticed this previous problem too for another game.

var score: Number = 0;

mc_game.mc_whatsinside.mc_coffee.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler);

function fl_MouseClickHandler(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mc_coffee);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

mc_game.mc_whatsinside.mc_Icecream.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler9);

function fl_MouseClickHandler9(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mc_Icecream);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

mc_game.mc_whatsinside.mc_Bottle.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler3);

function fl_MouseClickHandler3(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mc_Bottle);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

mc_game.mc_whatsinside.mc_Scissors.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler4);

function fl_MouseClickHandler4(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mc_Scissors);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

mc_Cutter

mc_game.mc_whatsinside.mc_Cutter.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler5);

function fl_MouseClickHandler5(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mc_Cutter);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

mcFireworks

mc_game.mc_whatsinside.mcFireworks.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler6);

function fl_MouseClickHandler6(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mcFireworks);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

mc_Magnet

mc_game.mc_whatsinside.mc_Magnet.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler7);

function fl_MouseClickHandler7(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mc_Magnet);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

mc_candle

mc_game.mc_whatsinside.mc_candle.addEventListener (MouseEvent.CLICK, fl_MouseClickHandler8);

function fl_MouseClickHandler8(event:MouseEvent):void

{

mc_game.mc_whatsinside.removeChild (mc_game.mc_whatsinside.mc_candle);

score = score + 5;

mc_game.mc_whatsinside.scoretxt.Text = String (score);

}

If you want to say that the score indicating in the textfield object shows the '4', then incorporate your policy in this textfield and make sure to include all the numbers.

Tags: Adobe Animate

Similar Questions

  • hitTestObject score increases, but it keeps going... it should increase by only one point

    hitTestObject score increases, but it keeps going...

    It should increase by only a point when I drag crescent at startup, but it runs point more and more until I have delete. a way to fix it?

    var score: Number = 0;

    addEventListener (Event.ENTER_FRAME, checkCollision);

    function checkCollision(event:Event) {}

    star test against crescent

    If (star.hitTestObject (crescent)) {}

    messageText2.text = "hitTestObject:Yes";

    score = score + 1;

    Text1. Text = String (score);

    } else {}

    messageText2.text = "hitTestObject: No.";

    }

    }

    my mistake.  use:

    var hitBool:Boolean

    var score: Number = 0;

    addEventListener (Event.ENTER_FRAME, checkCollision);

    function checkCollision(event:Event) {}

    star test against crescent

    If (star.hitTestObject (crescent)) {}

    {if(!hitBool)}

    hitBool = true;

    messageText2.text = "hitTestObject:Yes";

    score = score + 1;

    Text1. Text = String (score);

    }

    } else {}

    hitBool = false;  //<- if="" you="" want="" to="" allow="" another="" hit="" after="" a="">

    messageText2.text = "hitTestObject: No.";

    }

    }

  • My KDSR70XBR2 turned off and now only red light blinks six times then pause of 2 seconds followed

    TV off last night and gave a warning of the temperature.  I turn it off, put a fan behind it, but it still blinks six times then 2 second pause followed by six flashes and pause.  I did that for about 18 hours now.

    Help, please.

    The x 6 times standby light flashing indicates that the device has a power problem and may require services. To find an authorized service of Sony to your TV in your area go to:

    https://eService.Sony.com/webrma/Web/index.do

    Nathan_SD

  • sound recorder, no not enough memory available to complete this operation. Quit one or more applications to increase available memory, and then try again.

    I tried to use sound recorder to test a microphone and it came with an error message after pressing the record and then he said, sound recorder, not stop not enough memory available to complete this operation. Quit one or more applications to increase available memory, and then try again. This issue is out of nowhere because he has never had this problem before. It's a brand new computer that ive built from the bottom up, and I have 4 GB of memory. only a little more than 2 is actually identified by windows xp, however. Ive looked in the Task Manager and it says I have 2 GB of free, so I don't know what to do

    Hi superconfused123,

    This problem occurs because of a design limitation in the tape recorder.

    You can check the link below: you receive a "not enough memory to complete this operation" error message when you try to record a .wav file using sound recorder: http://support.microsoft.com/kb/284893

    With regard to:

    Samhrutha G S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Dial-up modem works for a short time, then he said "no dial tone".

    original title: Dial-up modem works for a short time, then he said "no dial tone" does not matter if the modem is to maintain or external. The same thing happens

    Living in an area where the wireless, wifi, broadband is not available, only wheel upwards. Modems worked well for a time, then more nothing. Use xp pro on a Dell computer

    Hello

    1. your phone work when modem says no dial tone?

    2. you have made no changes to the computer before the broadcast took place?

    3. What is the number of brand and model of Modem device?

    Follow the methods mentioned below:

    Method 1:

    Step 1: Run modem diagnostics .

    Note To follow these steps, use the default view of 'Category' in the control panel instead of the "Classic" view

    1. quit all programs, and then close all open windows.

    2 click Startand then click Control Panel.

    3 click on Printers and other devices. Click phone and Modem Options. Click the Modems tab.

    4 select the modem for which you want to run diagnostics on the modem. If you are unsure what modem to select, contact the manufacturer of your computer.

    5 click Properties. Click on the tab Modem Set the Maximum Port speed to 57600.

    6 click the Diagnostics tab.

    7 click Query Modem. If the modem answers and functioning, the information about the modem appears.

    Step 2: Run the Network Diagnostics.

    Network Diagnostics for Windows XP is available to help identify and fix network connection problems

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

     

    Method 2:

    How to troubleshoot "No dial tone" issues in Windows XP

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

     

    I hope that helps!

  • Edge animate only loop once then stops

    I have a file Animate Edge I want to loop continuously forever - and currently it will run once, loop once and then stop.

    I used the

    sym.getSymbol("FINAL_ANIMATION").play(0);

    code that normally would loop the animation (as I understand it - new edge animate)

    At the beginning I could not it to loop all independently of the code. But then I realized he wanted that one symbol of the loop and the animation was composed of several layers. I selected all and converted into one main 'FINAL_ANIMATION' symbol and he played very well and in fact but only a time loop

    Any thoughts? Never used edge animate before so far.

    Hello

    You must use: sym.playAll (0);

    Adobe Edge CC animated JavaScript API

    Note: You have no group symbols.

    Watch this demo file: playStopAll.zip - Box

  • Show only the time and a red relief

    My watch does not show the clock face. If I press the bottom button, it will display the time and a symbol of red light.

    Hello

    Your watch has a low battery charge level and entered into mode of power reserve.

    This mode displays only the time when you press the side button, in order to keep this service as long as possible.

    You will need to exit this mode, press and hold the side button. However, you need to charge your watch first. Allow up to 2.5 hours for a full charge.

    More information:

    With the help of power reserve - Apple Support

  • It shows the logo, but is not on even a while it does, but for only 2 seconds then shows new logo

    It shows the logo, but is not on even a while it does, but for only 2 seconds then shows new logo

    Hello

    Follow the instructions here, including contacting Apple Support or your Genius Bar reservation if necessary:

    If your iPhone, iPad or iPod touch won't turn on - Apple Support

  • Overview worked for me 3 - 4 times, then I can get the opportunity to do the overview more. Am I missing something?

    I've used the technology of floyover on the city of milwaukee about 4 times then it stopped giving me the opportunity to do so. y at - it a specific setting that I need to activate?

    Make sure you have the Wi - Fi Internet connection.

    Try

    Force reboot

    http://support.Apple.com/en-us/HT201559

  • Can you run the Interface of Inspection VBAI only once and then once more by a guest user?

    Can you run the Interface of Inspection VBAI only once and then once more by a guest user?

    I don't think I understand what you are trying to accomplish. You can connect a button on the front of the smart camera and trigger each acquisition. In VBAI check the triggered Acquisition under the tab trigger for the step to acquire Image (smart camera).

    Your smart camera is hooked up to a monitor? Is there something that you must do in LabVIEW that you can't do in VBAI about the step of user input?

  • After some time, my screen goes black have to re boot. It is only on I pc the other pc on the same monitor works okay my video card is on the card mother all ansawers would help t / you rkfjr

    After some time, my monitor goes black have to re start at 5 min to 2 h said mge device is grapish until this day.   It is only on I pc the other pc on the same monitor works okay my video card is on the card mother all ansawers would help t / you rkfjr XP HP pc 1.3 gh 512 ram 120g hd

    Assuming that the integrated graphics controller is OK, try the following:

    Launch a command (as a Runas administrator) window and enter the following commands in it:

    powercfg-h off

    powercfg/change-standby-timeout-ac 1440

    The first command turns off "Feature of putting into hibernation"

    The second command replaces the timeout stansby 24 hours when the system is connected to AC power.

    (The number is in minutes).

    Good luck.

  • Hi, my videographer of windows program opens only once. It is impossible to reopen it unless I restart the pc. And then he does that only once and then comes the same problem. Thank you

    Hi, my videographer of windows program opens only once. It is impossible to reopen it unless I restart the pc. And then he does that only once and then comes the same problem. Thanks in advance

    Just a thought...

    It may be interesting to try to open Movie Maker and go to...
    Tools / Options / compatibility... tab and left click of the
    "Restore all defaults" button / OK.

  • Acer logo appears 2 times then starts windows.

    Hi entire community of Acer.
    I recently bought an Acer S670MG or computer M679G of office with the following specifications.
    Processor Intel core 2 due 3.1 ghz. 6 MB of L2 cache.
    6 GB of ram ddr3 to bus 1066 mhz
    NVIDIA Geforce 9800GT 512 MB/256bits external graphics card.
    WD 1 TB SATA hard drive.
    and I faced a problem that when I turned ON computer it beeps Acer Empowering People appears a few seconds then display has disappeared. then after cutting seconds, once again beeps sounds and new Acer logo appears, and then starts windows. can someone help me why this happens. because of this, boot time is much longer.
    P. in the bios. I tried both modes of hard drive. RAID and native ide. in third place is AHCI, I think that I have not yet tried.
    Help, please.
    BIOS. energy or American mega trend.
    Windows 7 Ultimate 64 bit SP1.

    A link to all of the troubleshooting you have already done here:

    http://www.SevenForums.com/hardware-devices/293189-Acer-logo-appears-2-times-then-starts-Windows.htm...

    Problem seems to be resolved by applying this thread.

  • BlackBerry Smartphones phone rings only 2 times

    I have asked before about it and told me how to fix it. Well for some reason, that the phone is returned to ring only 2 times again and it is does not me enough time to respond! Someone knows how to fix this? Have the phone set to vibrate and ring to take a part of the alarm time or something? I do not know. Just try to understand it.

    I had to ring 3 times by disabling the tone + vibrate off and just keep it on your. But I'll call t-mobile and see if there is anything else they could do.

  • I can't download contact sheets to the site ftp continues to receive "an error occurred sending the file: access denied" it used 100% of the time, then about 70% not at all, having to send boards contact my clients. Using Version 6 on Imac.

    I can't download contact sheets to the site ftp continues to receive "an error occurred sending the file: access denied" it used 100% of the time, then about 70% not at all, having to send boards contact my clients. Using Version 6 on Imac. Any suggestions on how to make it work again?

    Hi Dayg,

    Please check your FTP settings in Lightroom.

    Are you able to connect and download using another FTP Client?

    Also try the steps below: -.

    1. from the Web in Lightroom module, click export instead of loading.

    2. save the Gallery to a location that you can find easily (like your desktop).

    3. manually copy the Gallery of his location to save to your FTP server.

    Let us know if that helps.

    Kind regards

    Assani

Maybe you are looking for

  • the connection is not approved

    Sir my Mozilla Firefox shows "connection is not approved.What should I do?-get me out of here!Technical details Www.gmail.com uses an invalid security certificate.The certificate is not approved, because no sender string has been provided. I am using

  • Tecra all models - how to set inventory number

    Hello For the past year, we used a tool to set the tag on computers laptop toshiba. It works from an external floppy drive, but the drive crashed en we have not all copies of this tool.I'm sure one of my colleagues to download this tool on the toshib

  • Satellite L70-A-139 - SSD upgrade

    Hello I have a Satellite L70-A-139, and I want to spend my HARD for one SSD drive. I already opened the back to see, and there is a label that saids "only 7mm. The ssd I want to buy is an EVO of 840 SSD 250 GB.But that one is 6.8 mm in height, the it

  • Battery won't charge and satellite A75 works on current alternative

    Hello I can't charge the battery and the laptop does not work on current alternative.The power is already checked and is ok. May this be an of faul?And why the laptop does not work without it? Any suggestions? Thank you very much!

  • How can I stop Outlook Express sends several empty messages with attachments

    How can I stop Outlook Express sends several empty messages with attachments