Some problems with the creation of game "Guess the number"

Hello.

I try to create the game number guess using classes...

The .fla file I am planing to have components such as Button and TextInput component flash library.

Also, I created GuessNumber.as with the GuessNumber class.

Problems:

(1) the following line works now:

playAgainBtn.enabled = false;

(2) I don't see after clicking on button event:

guessBtn.addEventListener(MouseEvent.CLICK, checkingYourGuess);

I have attaged files also all the code here:

package 
{
     import flash.display.Sprite;
     import flash.events.*;
     import flash.display.*;
     import flash.text.TextField;
     public class GuessNumber extends Sprite 
     {
          trace("class GuessNumber working!");
          public function GuessNumber()
          {
               startGuess();
          }
          
          public function startGuess():void
          {
               trace("begining startGuess function");
               
               guessBtn.useHandCursor = true;
               playAgainBtn.useHandCursor = true;
               playAgainBtn.enabled = false;
               
               outputText.text = "Try to guess number betwen 1 and 5";
               
               guessBtn.addEventListener(MouseEvent.CLICK, checkingYourGuess);
          }
          
          function checkingYourGuess():void
          {
               trace("begining checkingYourGuess function");
               trace("button guessBtn was clicked");
          }
          
          function winGame():void
          {
               trace("begining winGame function");
          }
          
          function playAgain():void
          {
               trace("begining playAgain function");
          }
     }
     
}

It's because you haven't written checkingYourGuess function correctly. You must pass the event in the event listener. As a matter of fact, you click an error survey.

You class should look like this:

package
{
     import flash.display.Sprite;
     import flash.events.*;
     import flash.display.*;
     import flash.text.TextField;
     public class GuessNumber extends Sprite
     {
          trace("class GuessNumber working!");
          public function GuessNumber()
          {
               startGuess();
          }

          public function startGuess():void
          {
               trace("begining startGuess function");

               guessBtn.useHandCursor = true;
               playAgainBtn.useHandCursor = true;
               playAgainBtn.enabled = false;

               outputText.text = "Try to guess number betwen 1 and 5";

               guessBtn.addEventListener(MouseEvent.CLICK, checkingYourGuess);
          }

          private function checkingYourGuess(e:MouseEvent):void
          {
               trace("begining checkingYourGuess function");
               trace("button guessBtn was clicked");
          }

          private function winGame():void
          {
               trace("begining winGame function");
          }

          private function playAgain():void
          {
               trace("begining playAgain function");
          }
     }

}

Tags: Adobe Animate

Similar Questions

  • Sierra Siri, «I have some problems with the connection...» »

    Guys,

    I just installed Sierra on my MacBook Pro (retina, 13 inches, early 2015) version 10.12. I can't get Siri at work, the app tracks, he hears what I'm saying, but after awhile, he returns with two messages, both on the screen and verbally "I have some problems with the internet connection. Please try again in a moment. "&"Sorry, I'm having problems with the connection. Please try again in a moment. »

    Any ideas?

    Thank you

    N

    It's a network problem.

    Check the proxy settings that blocks maybe, or a firewall.

    System Preferences > network > Advanced (for your current connection) > Proxies

    Something there?

  • Some problems with the videoheader

    Hey guys,.

    I have some problems with the videoheader in first Pro CC 2014/15. I also googled and tried almost everything I found. So I asked first on Twitter and they told me to ask this here again.

    So here go us: Clemens on Twitter: '@AdobePremiere correct it's ridiculous... Why is the videoheader visible on the good site but not on... in the picture you can see my problem and it's really annoying.

    I hope you can help!

    Kind regards

    Clemens

    Hi Vinay,

    well... my fault... I do not have the small area of drag (red rectangle) above the audioheader allowing to drag to the bottom of my videoheader.

    Thanks for trying to help me in Vinay

  • Unable to contact the Service Adobe, I have a problem with the number.

    Hello

    I would like to have more information about the Adobe domain controller. My intention is to buy the product and use it in my office, we are a small company (4 PCs).

    If I am wrong, I have to take the standard networks for Business Plan, but I can't organize any request for payment for more information, because I don't have a problem with the number I'm supposed to call.

    Y at - it another way to know if this software is very suitable for me and my business and most of all the how much it will cost.

    Thank you for your attention.

    Good day!

    I look forward to hear from you.

    Best,

    Augusto

    Hi Avgvstvs67,

    Please see this link: https://acrobat.adobe.com/in/en/pricing/business-pricing.html

    Kind regards

    Rahul

  • Some problems with the Satellite A210 - 11 p

    I bought my laptop Satellite A210 - 11 p in September last year, but over the few months Ive had some problems with it.

    1. it seems to be overheating to the point of not being able to touch the bottom of the laptop whose total stop me use it as a laptop. Is - this usual?

    2. the screen turns off after approximately 2 minutes after the connection.

    3. any ideas where I can buy a new charger?

    Can you help me?

    Thank you
    Mike

    1 could be an accumulation of dust in the radiator. An FSL can remove it for you, or you can blow with a can of compressed air.
    2 power settings? Perhaps the Toshiba Power Saver is set to decrease intensity when loading in the system tray.
    3. I think an ASP can sell you a.

  • Some problems with the construction of project in Eclipse

    I use js + css3, html5 in my project for smartphone.

    And I have problem (error) with a construction project.

    ---------

    [INFO] Parsing of the command line options
    [INFO] Bbwp.properties analysis
    [INFO] Validation of archive application
    [INFO] The analysis of config.xml
    [INFO] The application of filling source
    [ERROR] Feature is not found in any extension (blackberry.bbm.platform)
    BUILD CAME OUT WITH 1 ERROR

    ---------

    What should I do to fix this error?

    Thank you!

    Thank you!

    I accidentally duplicated the subject, and the problem was solved in http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Some-problem-with-building-proje...

  • Hello! Someone has some problem with the haptic on Macbook 12 "2016 function? It does not work on my Mackbook.

    I'm trying to figure if someone has my problem with the haptic on Macbook 12 "2016 function. The option is checked in the preferences system, but it does not work.

    Thank you

    Hello luigi10m,

    Thanks for posting on the Community Support from Apple. From your post, it looks like your haptic feedback does not work when you click using your trackpad and the setting is enabled. I know that this is a great feature and it is important to make it work. I'll be happy to help you.

    First of all, I would like to assure you that in system preferences > Trackpad > clicking silencer is not checked, that might help. In addition, it would be useful to reset the settings of the SCM. You can find instructions here: reset the management system (SCM) controller on your Mac - Apple Support

    I'll also include those for you here:

    1. Stop the Mac.
    2. Plug the MagSafe or USB - C adapter to a power source and to your Mac.
    3. Use the built-in keyboard, press shift-control-Option on the left side of the keyboard, then press the power button at the same time.
    4. All the keys to unlock, then press the power button to turn on your Mac

    Take care!

  • Some problems with the Camileo webcam

    Hello!

    as a first step, please excuse me for my poor English writing!

    I have a TV and it seems that many users in France have the same problems as me:

    * When I'm in webcam mode, I cannot use the microphone of the camileo, is this normal?
    * When I try to open my movies in windows movie maker, it crashes. What is the problem? It seems that the video format of the camileo is not recognized by this software,... strange!

    Thank you very much!

    Yann

    I saw this cam but I'm not familiar with the whole feature. The fact is that each webcam with built-in mic should offer its use with different applications such as Skype, MSN, ICQ and others.

    In my opinion, there is a problem with the settings and check these settings in the application, you use. In most of them, you will be able to select the sound source.
    All video format I can say that based on the description you can choose between AVI and MPEG4 format.

    By the way: you try to open the files saved on the HARD drive?

  • Problem with the number of files?

    Hello guys,.

    I have a problem with the compilation of some projects...

    I realize that when my project 201 records in total (including the file config.xml, Active Directory and directory ext) they do not compile.

    If I delete all the files (if the project has 200 files in total), the success of occours compilation.

    See:

    E:\BlackBerry WebWorks Plug - in Eclipse\plugins\net.rim.browser.tools.wcpc_1.5.1.201010291444-22\wcpc>bbwp.exe "C:\Documents and Settings\Softwell\Desktop\blackberryhtml5.zip".

    [INFO]                  Parsing of the command line options

    [INFO]                  Bbwp.properties analysis

    [INFO]                  Validation of archive application

    [INFO]                  The analysis of config.xml

    [INFO]                  The application of filling source

    [INFO]                  Compilation of application BlackBerry WebWorks

    java.io.IOException: cannot run program ""E:\BlackBerry"(in the"C:\DOCUME~1\Softwell\CONFIG~1\Temp\widgetGen.4723774651307629071871.tmp"directory): error = 87, Parometro incorreto CreateProcess.

    [ERROR]                 CAP exception has occurred

    Can someone help

    Hello tneil,

    Well, I found the problem and a solution.

    The thing is: my project was not limited by the size, this is the number of files (200).
    I realized that BB has released an SDK 2.0 (I used 1.5) and I tryied to compile with the 2.0 and everthing works fine!
    The problem is how bbwp.exe communicate with rapc.exe, maybe he tryies to send files by command line and it has a limit. With the new sdk, it uses a file temp with all orders. This is why it works.

    The maximum size of 7MB, I can't say anything, because my apps are about 3-4 MB. But good to know, if I can put in my documentation.

    That's all.
    CYA

  • Problem with the number of lines in the channel

    Dear community LabView,

    I'm relatively new to labview and I came across a problem that (I assume) can easily be resolved with your help.

    I need to create a digital signal to trigger a camera, but I have a problem with the configuration of my lines or exit lanes. I would not use that line output to trigger the camera. (I use a card NI PCIe-6353). LabVIEW is telling me that the number of lines in the channel does not have the number of rows of data:

    Possible reasons:

    Specified read or write operation failed because the number of rows in the data of a string is not the lines in the channel.

    If you use the digital waveform data type, make sure that the number of lines in the digital waveforms is the number of lines in the channel. If you are using Boolean data, make sure that the dimension of the array for the rows of the data is the number of lines in the channel.

    Number of lines in the channel: 1
    Number of data lines: 2

    Task name: _unnamedTask<11>

    How and why the number of data rows is connected to the resolution of my analog digital converter?

    I would appreciate your help! Labview code and a screenshot attached.

    Thank you

    Beff

    I got it to work by changing the "data format" "binary not signed" OR by plugging is not the "offset" for the Square Wave VI.  I think that the default "offset binary" data format works correctly if there is a negative value.

  • Had some problems with the montage of images in the thumbnails slideshow widget

    Hello

    If someone can maybe give me some advice to fit correctly some photos in the slideshow of thumbnail widget.

    Here is the Web page: PORTRAIT of CAROLINE

    You will see that some of the images are in place and others do not. I want to keep all the in a square form, but the editing got some problems. I tried to resize the pictures with photoshop without success.

    So any tips?

    Try to change the orientation of the images and save the same format and then use in miniature.

    Thank you

    Sanjit

  • I have some problems with the Flash cs6 work

    I have a problem with my game when I created it using adobe flash cs6

    When the duck strikes the screen, from right to left as it shows

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    Duck / ducksmove)

    at flash.utils::Timer/_timerDispatch()

    at flash.utils::Timer/tick()

    This is the code so please help check that does not

    package {}

    import flash.display.MovieClip;

    import flash.utils.Timer;

    import flash.events.TimerEvent;

    import flash.events.MouseEvent;

    Duck/public class extends MovieClip {}

    var moveDuck:Timer = new Timer (10);

    var speedX:Number;

    public void Duck() {}

    this.addEventListener (MouseEvent.CLICK, KillDuck);

    moveDuck.addEventListener (TimerEvent.TIMER, ducksmove);

    moveDuck.start ();

    speedX = 10;

    }

    function ducksmove(evt:TimerEvent):void

    {

    This.x = speedX;

    If (this.x < = 0)

    {

    moveDuck.stop ();

    moveDuck.removeEventListener (TimerEvent.TIMER, ducksmove);

    this.parent.removeChild (this);

    }

    }

    function KillDuck(evt:MouseEvent):void

    {

    var p:MovieClip = this.parent as MovieClip;

    p.setScore ();

    p.UpdateCount ();

    this.removeEventListener (MouseEvent.CLICK, KillDuck);

    this.parent.removeChild (this);

    moveDuck.addEventListener (TimerEvent.TIMER, ducksmove);

    }

    }

    }

    You seem to be trying to delete the same object twice, in the KillDuck function, then in the ducksmove function.  If it is removed already you can not try to remove it again because it is no longer in the display list.

  • Some problems with the LAN on Satellite L10 card after BIOS update

    Hello

    I have a problem with my satellite L10. Map does not work after the installation of the new network of edge of Bios (2.80).
    I tried it on Linux, BSD and WinXp. OS see my net card.
    I can even install parameters and ping 127.0.0.1 and my ip.

    But all the other pool spoke to me query time-out.

    Help me please.

    Hello

    What to say I put t think that this could be linked to the BIOS. First of all, as you said that the LAN card is recognized correctly in the device if Manager she s works well!

    However, you could try to access the BIOS and could set the BIOS default settings. Don t forget to save changes to BIOS ;)

    In addition, it would be advisable to reinstall the NIC driver. The Toshiba driver page provides the Realtek LAN driver v5.618.1015.2004.

    Good luck

  • Some problems with the Dell U2713H monitor profiling

    I bought the Dell U2713H monitor.

    I can't find a lot of answers for profiling it. Company Dell does not have any instructions on this subject - so I think it's very bad.

    For example, I am interested in the following questions:

    I create profiles with ' Solution of Calibration Dell UltraSharp"and i1Display Pro.»

    They record the monitor LUT directly, or LUT-video card?

    Now I did 4 profiles, but it is not clear what profile using mode CAL1 oder CAL2 my monitor color space?

    For example. I made a profile with the color space sRGB, but I did not see it in any mode CAL1, CAL2 oder overall.

    Download and install them DA 1.5.3:
    http://www.Dell.com/support/home/us/en/19/drivers/DriversDetails?DriverID=VJVPH

    Then make sure that yout GPU does not apply "color improvements."

    Run DA and select calibration target and slot of calibration HW store. For example:

    -Preset: sRGB, 120cd/m2

    ICC - version 2 (a MUST to validate it with 3rd party applications), Bradford or CIECAT02 chromatic adaptation, table function, 400 patches, "calibration 1" profile = CAL1 slot

    Once completed, it will ask for a file name, for example, you choose "U2713H_CAL1.icm" and click OK. The profile will be created and set as the default profile for the screen of your operating system Wndows.

    Lunge CAL1 has been stored in a LUT3D of calibration of the "sRGB" @ 120cd/m2. In "U2713_CAL1.icm", it is stored:

    -a linear LUT (output = input), clealing all calibration in GPU

    -actual behavior of range and gamma of OSD CAL1 predefined after calibration.

    It goes the same for CAL2.

    Don't forget that most applications like Photoshop need color management real mode the monitor OSD to have their good active ICM as a 'default' before opening this color managed application.
    For example, if you calibrated CAL2 = AdobeRGB and have a U2713_CAL2.icm, and you want use CAL2 in Photoshop, this profile must be defined as a default value in the OS color management prior to Photoshop.

  • simple thing, I want that back photoshop, illustrator, indesign, lightroom, muse not much to ask, but it seems to be some problems with the adobe Manager and cs6 forget cs6, I just want to back cc 2015, I've been stuffing autour with this all day

    Ouch even tracks of communities a mistake

    Please read https://forums.adobe.com/thread/1499014

    -try some steps such as changing browsers and disable your firewall

    -also clear the cache of your browser if you start with a fresh browser

    http://myleniumerrors.com/installation-and-licensing-problems/creative-cloud-error-codes-w ip.

    http://helpx.Adobe.com/creative-cloud/KB/failed-install-creative-cloud-desktop.html

    or

    A chat session where an agent can remotely look inside your computer can help

    Cloud creative support chat (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

Maybe you are looking for

  • How to activate bluetooth on HP ProBook s 4540?

    Greetings, I recently bought this ProBook s 4540. I tried to understand how active my bluetooth. I have tried several drivers but ended up with nothing. So what I need is an instruction step by step to activate my bluetooth. Help for Windows 7 Ultima

  • How to print the jobes username printed by printer usingnetwork

    Please how to print the user name on paper printed for each print job printed paper

  • View internet to two monitors at the same time

    Can you tell me how to adjust laptop screen, so I can open it in the laptop and my desktop height monitor, andI'll be able to close my laptop and working on the desktop monitor? Thank you

  • Need help on this one

    This occurred only during the few days and don't know why. Hoping someone here can solve this problem for me.Whenever I use the black point in curves that it washes out the picture.See you soonGerry

  • I don't know if I'll get a refund

    I just cancelled my subscription to a single application to the month of illustrator, it is renewed each month and they make a load but I just cancelled the same day, they did the second count, I don't know if I'll get that a refund of the renewal I