The n argument error

Hello

I did a pretty simple program, but I get this error message:

ArgumentError: Error #1063: incompatibility of County of Argument on breathalyser1_fla::MainTimeline / checkDrink (). expected 0, got 1.

I know its something simple to fix, but for the life of me I can't find where I need to make the correction.

Here is my code:

Stop();


var drink: String = "null";


beerselect_mc.Alpha = 0;

wineselect_mc.Alpha = 0;

alcopopselect_mc.Alpha = 0;

spiritselect_mc.Alpha = 0;


answer_btn.Alpha = 0;


Buttons


beer_btn.addEventListener (MouseEvent.CLICK, beerSelected);

wine_btn.addEventListener (MouseEvent.CLICK, wineSelected);

alcopop_btn.addEventListener (MouseEvent.CLICK, alcopopSelected);

spirit_btn.addEventListener (MouseEvent.CLICK, spiritSelected);


Functions


function beerSelected (e:MouseEvent): void {}

drink = "beer";

beerselect_mc.alpha = 1;

wineselect_mc.alpha = 0;

alcopopselect_mc.alpha = 0;

spiritselect_mc.alpha = 0;

answer_btn.alpha = 1;

}


function wineSelected (e:MouseEvent): void {}

drink = 'wine';

beerselect_mc.alpha = 0;

wineselect_mc.alpha = 1;

alcopopselect_mc.alpha = 0;

spiritselect_mc.alpha = 0;

answer_btn.alpha = 1;

}


function alcopopSelected (e:MouseEvent): void {}

drink = 'alcopops';

beerselect_mc.alpha = 0;

wineselect_mc.alpha = 0;

alcopopselect_mc.alpha = 1;

spiritselect_mc.alpha = 0;

answer_btn.alpha = 1;

}


function spiritSelected (e:MouseEvent): void {}

drink = 'spirit';

beerselect_mc.alpha = 0;

wineselect_mc.alpha = 0;

alcopopselect_mc.alpha = 0;

spiritselect_mc.alpha = 1;

answer_btn.alpha = 1;

}


Answer button


answer_btn.addEventListener (MouseEvent.CLICK, checkDrink);



Answer button function


function checkDrink() {}

If ((drink == 'beer')) { }

gotoAndPlay("beeranswer");

{ } ElseIf ((drink == "wine")) { }

gotoAndPlay("wineanswer");

{ } ElseIf ((drink == "alcopops")) { }

gotoAndPlay("alcopopanswer");

{ } ElseIf ((drink == 'spirit')) { }

gotoAndPlay("spiritanswer");

}

}

I am being dense and missing something really obvious?

checkDrink() is an event handler. As such, it must have an argument passed into it - MouseEvent.

Thus, it is supposed to be:

function checkDrink (e:MouseEvent): void {}

the rest of the code.

}

In addition, it is preferable to use switch... case here

Tags: Adobe Animate

Similar Questions

  • I have the following error on my phone design-MuseJSAssert: error calling the function switch: Error: Invalid argument

    I tried to insert the third party html code 'a noaa weather map' in the design of my phone yesterday. It did not work well. So I deleted this return. Afterwords, I get the following:

    (Message on the Web page "MuseJSAssert: error by calling the function selection: error: invalid argument.")

    I already have all the design is complete and ready to publish. The desktop version works fine. But the design of the phone does not work. For the most part, I noticed that the menu master accordion does not work now.

    Help! I really want to redo the whole phone design. Thanks, H

    I have already found and corrected the error. Apparently, when you bind a phone

    Number of muse, he is not obliged to put a colon: in the figures. I have

    have removed the colon and handed over running the program and the error is cleared

    upward. A clear tutorial on the 'phone links' would be useful.

    Thank you. H

  • That is producing this error: MuseJSAssert: error calling the function switch: Error: Invalid argument

    Website: http://lovehopemercy.org/

    In my navigation header by clicking on the option "VISIT US", that is to say generates this error: MuseJSAssert: error calling the function switch: error: invalid argument

    The other options do not work correctly. I get an error on export as HTML of MUSE, but the link works fine in other browsers. I download using Dreamweaver CC 2014. Reversal function works fine; it's the direct click of the menu item at the top that causes the problem.

    Did I miss a bad link or something that I can fix?

    Thanks in advance.

    Hello

    Could you please try some suggestions given here and see if it works for you.

    Error after update today: MuseJSAssert:Error call function argument: Error: Invalid selector

    Let me know if you have any question.

    Concerning

    Vivek

  • Problems with the shipment of the Job_ID argument with a processflow EMAIL activity

    Hello everyone,

    I have a problem with a simple process flow.

    I want to send an EMail that contains in the MESSAGE_BODY the Job_ID argument in the workflow began. That's why I wrote a function with a select statement that gives back the number.

    Code:
    l_owb_id VARCHAR2 (20);

    BEGIN

    Select to_char (top_level_execution_audit_id)
    in l_owb_id
    of ALL_RT_AUDIT_EXECUTIONS
    where task_name = "XYZ".
    and created_on as sysdate;

    return (l_owb_id);

    END;

    The feature works very well. So I put it in my workflow. Now, I wanted to link the MESSAGE_BODY from the activity of e-mail with the parameter of the function. But when I click on validate it displays following error:
    VLD-10042: MESSAGE_BODY from the EMAIL parameter is incorrectly bound. Output of cannot be converted to a constant value.

    VLD-10042: MESSAGE_BODY e-mail activity is linked to the GET_OWB_ID parameter of. Activities must be related by an intermediate variable

    Can someone help me how to fix this proplem. How can I send the process ID by e-mail activity in a Workflow. On the internet I have not found whatever it is useful, any help would be appreiciated.

    Kind regards

    Daniel

    Yes, you can add the text with the variable values in the message field.

    See you soon
    Katia

  • Why always show that "there is a connection to the Apple store error."? It has been a month I am facing such a problem. How can I fix? Hope you have a solution to this...

    Why always show that "there is a connection to the Apple store error."? It has been a month I am facing such a problem. How can I fix? Hope you have a solution to this...

    I don't know if this is the problem, but it is something that must be correct establish a secure connection:

    Open Date and time preferences system, Date & time tab. Make sure that it is set to automatically set the time.

    Alternatively, make sure that your date/time is correctly set to the second.

    Another thing to try is to restart your modem and router.

  • Impossible to install the Safari extensions; error message

    Impossible to install the Safari extensions; error message

    Hello

    Make sure that OS X and Safari are up-to-date.

    Open system preferences > App Store, then click on: check now

    Your profile says your Mac works v10.11.1. The v10.11.5 update is available. This is maybe the reason why you can not install the Safari extensions.

  • The program displays error 1 airport

    I have a network of 2 time Capsules from the airport and 2 Airport Express. One of the time Capsule is the main base of the network, the other edefinde ar as extension. Everything works perfectly since ages. Today, the main basis had the yellow light. I power market and everything happened after commissioning in normal operation. Later I started my program from the airport and here it shows me each device, but each device gets a sign, Red '1' in a button white. When I click it, I just get the detailed information of the device. Amazing that I don't get this message on the program from the airport to my iPad.

    I run on my MacBook Pro, 3 GHz Intel Core i7, OS X El Capitan 10.11.6 Beta (15G7b), on time as well as the AirPort Express Terminal Capsules 7.6.4 Version.

    No idea what this '1' means? I couldn't find any information in FAQ or support for the network in error messages.
    The network actually works, so I don't know if it's an error message or just any type of warning.
    Thank you, Roger Che.

    Yesterday, I received these insignia (white '1' in red).  He indicated that there are updates firmware for all my devices from the airport.

  • Consol error showing all the types of errors

    Consol error showing all the types of errors

    Are one of these errors to your Firefox problem?

  • Receive the "403 Forbidden" error code on a Web site, I've been accessing years. It is written "forbidden you don't have permission to access the/_cqr/login on that server." I can access this site (AOL) on other browsers. Help!

    Receive the "403 Forbidden" error code on a Web site, I've been accessing years. It is written "forbidden you don't have permission to access the/_cqr/login on that server." I can access this site (AOL) on other browsers.

    I emptied my cache.  I rebooted Firefox.  This is my email website - never had a problem before.  I am able to access it on Safari.  I even tried the simple address (rather then my bookmarked login address) - still got the same error message!
    

    I have the same problem: it is written ' forbidden you don't have permission to access the/_cqr/login on that server. " I can access this site (AOL) on other browsers. After that I connected to AOL, I get this message. then I go to the address line and delete everything after than the aol.com and her and then press ENTER. then, I'm registered and can read my emails. How can we solve this problem?

  • HP Officejet Pro 8620 does not print, but the document is sent to the printer without error

    I bought a HP Officejet Pro 8620 and connect 2 computers via a wireless connection with the latest driver.
    In the first computer (windows 7) I can print without any problem
    On the second one (windows 8), when I try to print, I can see in the windows printer spooler file that I'm going to print. The file is sent to the printer, without error, BUT nothing happens.
    I already tried reinstalling the drivers, restart the computer, the printer. I tried to connect to a wired network. It still does not. It's very weird but I got no error, just does not print. I thought that the printer does not work, but on the second computer I can print.
    Thank you for your advice

    Hello

    Please download and run the HP print and Scan Doctor www.hp.com/go/tools

  • upgraded to 3.6, bookmarks, lost, lost the toolbar bookmarks, bookmarks library, lost cannot go to the previous backup, error message. Not have Torbutton. Cannot save new bookmarks. AutoFill remembers. Don't forget the story is about.

    upgraded to 3.6, bookmarks, lost, lost the toolbar bookmarks, bookmarks library, lost cannot go to the previous backup, error message. Not have Torbutton. Cannot save new bookmarks. AutoFill remembers. Don't forget the story is about.

    I got this yesterday after the 3.6.4 problem upgrade. I'm not sure if I saw all the things you did, but I have def lost all bookmarks and the back button. I fixed it by:
    1. go to the Firefox profile directory, which for me is here but 1st bit will be different for you as mine work specific:

    C:\Documents and Settings\U049177\Application Data\Mozilla\Firefox\Profiles\soez0lvk.default
    2 delete places.sqlite and places.sqlite - journal

    3. start Firefox (you should have the back button now works but not Favorites, he recreated to these 2 files)

    4. in the menu, bookmarks and then organize bookmarks, then button import and backup, then restore, then select a day to restore from. You should now have your backups Firefoxes bookmarks.

    Hope this works for you

  • What is the Code for error AHT 4HDD/11 / 40000004:SATA (0,0)

    What is the Code for error AHT 4HDD/11 / 40000004:SATA (0,0)

    This means you have a hardware problem related to the hard drive. The disk may be corrupted or fails and must be replaced. Save your file as soon as POSSIBLE. If the player does not have little time for the backup.

  • My computer makes a clicking noise at random - in the diagnosis of the Apple what is the meaning of error 4HDD/30 / 40000005:SATA (0,0) Please?

    My computer makes a clicking noise at random - in the diagnosis of the Apple what is the meaning of error 4HDD/30 / 40000005:SATA (0,0) Please?

    Several clues:

    1. HARD and SATA drive in the message... On the way SATA HARD drive
    2. Clicking noise, which is an early signal of imminent death for HARD drive (there are only two types of readers... those who died and those who will be)

    I would like to start keep good clones (CarbonCopyClone, bombich.com, $40) for external drives or backups Time Machine.  Any backup of the drive, not just your favorite parts.  Perform backups on a schedule without fail IMHO.

    You can also start to consider a SSD at macsales.com (their mercury collection is highly recommended) or a new HARD disk, at least start planning if the SSD cost is worth the benefit of speed on the HARD drive.  You can buy it later.

    Just my paranoid approach to this situation.

  • My camera so far not this problem and all of a sudden I saw this error in various parts of the phone and ask you to consider the problem of error code 1009

    My camera so far not this problem and all of a sudden I saw this error in various parts of the phone and ask you to consider the problem of error code 1009

    Apple ID: *.

    Did you check out this article? Seems to be linked to the AppStore and the country where you're:

    Why my iphon give me error code 1009?

  • Pavilion dv7-6b20ex: since the upgrade to windows 10 I get the update message error 0 x 80240017 Windows Defender

    hi..

    Since the upgrade to windows 10 I get the update message error 0 x 80240017 Windows Defender

    I hope to have useful response... Thank you

    This letter specifically;

    Updated definition for Windows Defender - error (definition 1.203.2341.0) KB2267602 - 0 x 80240017

    Updated definition for Windows Defender - error (definition 1.203.2341.0) KB2267602 - 0 x 80240017

    https://support.Microsoft.com/en-us/KB/918355

Maybe you are looking for

  • Download Toshiba Journe Air 801 Software

    Hello I need the software for the Toshiba Journe Air 801, because my CD no longer works and I have formatted my pc. I searched all over the Internet, but there is no software downlaod from my device. I Horde can someone help me.

  • Open a document saved with my numbers program numbers

    I am trying to open a document in numbers that I recorded as a numbers document.  It does not open so I can change it, I'm only able to print the document.  I have other documents of numbers that I can open and edit, but it does not open so I can cha

  • Latest CD of music 2or3 deform after a time

    Successfully burned CD quality music and played ok, but after a long enough period of time that the final tks are only beginning to skew bad - why is this and is the so-called "rotten CD? ..... Thanks John [Moved from the community centre of Particip

  • HP_RECOVERY(D:) est presque plein)

    Bad luck. I pressed the wrong button. Problem not yet solved.

  • Slight hiss on Z2 camera

    I recorded the same scene on the compact Z2 and Z1 and Z2 has a metallic sound coming from it. Z1 compact: https://www.YouTube.com/watch?v=EmYoewxtnAA Z2: https://www.YouTube.com/watch?v=KsuzRX8ylwA