Checking three 'if' statements are correct or wrong

Hi Guys
I'm working on a quiz where a user has to drag three movie clips to correct positions then press the 'next' button to move on (calls funtion nxt)
I have nxt function to check to see if the three movie clips have been dragged onto the three correct positions (other movieclips), the code works but only if all three are correct.
I want the function to check to see if all the clips have hit the right target,
if so, then add +1 to the 'score' and go to frame 'end'
if the clips aren't on the right target then just go to frame 'end'
At the moment the nxt function doesn't work if the answers are wrong.
Can anyone point me in the right direction?
The quiz is here online, only four questions
and here's the code for question 4 that i need some help with...
function nxt(event:MouseEvent):void
if (asc1_mc.hitTestObject(blank1_mc))
if (shou_mc.hitTestObject(blank2_mc))
if (crossb_mc.hitTestObject(blank3_mc))
{score++;
gotoAndStop ("end")}
else
{gotoAndStop ("end")}

How about this?
function nxt(event:MouseEvent):void
     if ((asc1_mc.hitTestObject(blank1_mc)) &&
          (shou_mc.hitTestObject(blank2_mc)) &&
          (crossb_mc.hitTestObject(blank3_mc))
         score++;
     gotoAndStop ("end");

Similar Messages

  • I have solved some questions, please check if my answers are correct

    Hi every Java aces,
    I have solved some programming questions, please check if my answers are correct. Thanks
    Here are the questions and the answers to each question
    (a) Write a method called add that takes three integers as parameters and returns an
    integer that is the sum of the three parameters.
    (b) Write a method called max that takes three integers as parameters and returns the
    largest of the three integers.
    (c) Write a method called printMax that takes three integers as parameters and prints
    the maximum value to the screen. The method should return nothing. The method
    should print the words \The maximum value is " followed by the maximum value,
    followed by a new-line character. You should try to use the max method that you
    wrote earlier.
    (d) Write a method called min that takes three integers as parameters and returns the
    smallest of the three integers.
    (f) Write a method called ticketPrice that takes one integer parameter representing
    the age of a person, and returns the price of a movie ticket in dollars (as a
    oating
    point value). Children under 6 get in for free (0.00), people that are 18 or under
    pay 8.50, senior citizens (65 or older) pay 6.50, and all other people pay 10.00.
    (g) Write a method called isDivisor that takes two integers as parameters and returns
    true if the rst parameter is a divisor of the second parameter or false otherwise.
    We say that m is a divisor of n, or that m divides n, if there is an integer k such
    that n = k m. Note that 1 divides every integer, and every integer divides i
    itself .
    here are my codes
    public class Methods
    // This is method (a)
    public static int add (int a, int b, int c)
    int sum = a + b + c;
    return sum;
    // This is method (b)
    public static int max (int a, int b, int c)
    int largest;
    if (a > b)
    if (a > c)
    { largest = a; }
    else
    { largest = c;}
    else
    if (b < c)
    { largest = c; }
    else
    { largest = b;}
    return largest;
    // This is method (c)
    public static void printMax (int d, int e, int f)
    int maxValue;
    maxValue = max (d, e, f);
    System.out.println ("The maximum value is " + maxValue);
    // This is method (d)
    public static int min (int a, int b, int c)
    int smallest;
    if ( a < b )
    if ( a < c )
    { smallest = a; }
    else
    { smallest = c; }
    else
    if ( b > c )
    { smallest = c; }
    else
    { smallest = b; }
    return smallest;
    // This is method (f)
    public static double ticketPrice (int age)
    double price;
    if ( age < 6 )
    { price = 0.00; }
    else
    if ( age <= 18 )
    { price = 8.50; }
    else
    if ( age < 65 )
    { price = 10.00; }
    else
    { price = 6.50; }
    return price;
    // This is method (g)
    public static boolean isDivisor ( int m, int n )
    boolean result;
    int check1;
    double check2;
    check1 = n / m;
    check2 = (double)n / m;
    if ( check2 == check1 )
    { result = true; }
    else
    { result = false; }
    return result;
    }

    Here are my codes
    // This is method (a)
      public static int add (int a, int b, int c)
        int sum = a + b + c;
        return sum;
      // This is method (b)
      public static int max (int a, int b, int c)
        int largest;
        if (a > b)
          if (a > c)
          { largest = a; }
          else
          { largest = c;}
        else
          if (b < c)
          { largest = c; }
          else
          { largest = b;}
        return largest;   
      // This is method (c) ?
      public static void printMax (int d, int e, int f)
        int maxValue;
        maxValue = max (d, e, f);
        System.out.println ("The maximum value is " + maxValue);
      // This is method (d)
      public static int min (int a, int b, int c)
        int smallest;
        if ( a < b )
           if ( a < c )
           { smallest = a; }
           else
           { smallest = c; }
        else
          if ( b > c )
          { smallest = c; }
          else
          { smallest = b; }
        return smallest;
    // This is method (f)
      public static double ticketPrice (int age)
        double price;
        if ( age < 6 )
        { price = 0.00; }
        else
          if ( age <= 18 )
          { price = 8.50; }
          else
            if ( age < 65 )
            { price = 10.00; }
            else
            { price = 6.50; }
        return price;
      // This is method (g)
      public static boolean isDivisor ( int m, int n )
        boolean result;
        int check1;
        double check2;
        check1 = n / m;
        check2 = (double)n / m;
        if ( check2 == check1 )
        { result = true; }
        else
        { result = false; }
        return result;
       // This is method (h)
      public static boolean isProduct ( double a, double b, double c )
        boolean result;
        if ( a == b*c )
        { result = true;}
        else
        { result = false;}
        return result;
         

  • Checking AppleID, my addresses are correct, but on second step for security, Apple advises it will send text for assistance and lists an account I do not know.  How do I change this?

    Checking AppleID, my addresses are correct, but then on second step for security, apple sent text to unknown address.  How do I change this?

    Does this apply?
    If you're asked for the password to your previous Apple ID when signing out of iCloud - Apple Support

  • My synced Photos on the iPhone are wrong. The Thumbnails are correct but wrong pictures appear if i open them. What can I do?

    my synced Photos on the iPhone are wrong. The Thumbnails are correct but wrong pictures appear if i open them. What can I do?

    There is no list of authorized computers.  Where do you see a list?
    You must be talking about something other than authorization.  Please clarify.
    iTunes Store: About authorization and deauthorization

  • How can i check my setting details are correct on my iPhone I recevied an error when sending a text this morning and while checking it out noticed my state and city are wrong

    How can i check my setting / about tab? This morning I got an error message say something wasn't safe (not sure what) I think it was my common name whcih is ch4iv.myvzw.com and while looking in there I noticed my state say NJ I live in PA, I did not buy my phone in NJ, the city says Bedminster I have never even been there. Can anyone advise?
    Can't I go on my Apple account and get to my setting / details.

    Here is the message...

  • Check in filled values are correct

    Hello,
    I have a web interface with two layouts, the first one is just a description and the second one where you enter data.
    For the key figure concerned, they have to reach the number showed in the first layout distributing it in the second layout by diff characteristics.
    I would like to make a check before the data is saved.
    I would like to show a message like "the sum of the values you entered is greater(lower) than the numbers of employees in your team" ... etc...
    Maybe a user exit function is to be created, but where to place it ? In the after data change function in the web application builder ? And how to generate the message in the user exit ?
    Any help is welcome.
    Regards.

    I already did it ( the dubble click on the inputprocessing) since the beginning.
    But in the method, i don't find the code you mentioned.
    I don't see where the save button s treated. I fall down to others calls and methods, but deeper i fall on the standard UP... function modules.
    This the code of method inputprocessing in our system :
    method called from BSP when an event appears
    method inputprocessing .
      data: page_name         type string,
            subordinate_event type string,
            ls_handler  type upwb_ys_handler,
            method_subrc type sysubrc,
            eventtype   type char2, " UPWB_Y_HANDLER_TYPE,
            id          type string.
    get runtime event id from HTMLB
      if event_id = cl_htmlb_manager=>event_id. " HTMLB event?
        data: lr_htmlb_event type ref to cl_htmlb_event.
        lr_htmlb_event = cl_htmlb_manager=>get_event(
            runtime->server->request ).
        if lr_htmlb_event is not initial.
          event_id = lr_htmlb_event->id.
        endif.
      endif.
    Set runtime environment for components
      cl_upwb=>bsp_oninputprocessing(
          event_id   = event_id
          runtime    = runtime
          navigation = navigation
          page       = page
          request    = request
          version    = version ).
      m_event_id = event_id.
      mr_navigation = navigation.
      mr_page = page.
      mr_request = request.
    mr_response = response.
      mr_runtime = runtime.
      m_version = version.
    The id before '-' is the component name, that fires the event
      split event_id at '-' into event_id subordinate_event.
    By default no error in input check
      clear subrc.
    Request handling
      data: l_request_no    type string.
      if mr_application is not initial. " (check: no session time-out)
        l_request_no = request->get_form_field( 'bps-request_number' ).
      if the request handling is active (backward compatibility)
        if request->get_last_error( ) = 0
           and l_request_no is not initial.
          if l_request_no <> cl_upwb=>get_parameter( 'bps-request_number' ).
          the request is NOT correct!!!
          => THE ERROR PAGE SHALL BE DISPLAYED
            cl_upwb=>set_parameter( param = 'bps-request_ignored'
                                    value = 'X' ).
            subrc = 10. " skip PBO
            exit.       " skip PAI (input processing)
          else. " request OK...
          the request is expected, increase the request counter
            add 1 to l_request_no. condense l_request_no.
            cl_upwb=>set_parameter( param = 'bps-request_number'
                                    value = l_request_no ).
            cl_upwb=>set_parameter( param = 'bps-request_ignored'
                                    value = '-' ).
          endif. " request OK
        endif. " request handling is active
      endif. " no time-out
    Timeout handling
      if mr_application is initial.    " session time-out
        concatenate runtime->application_name '_exit.htm?timeout=1'
            into page_name.
        if request->get_form_field( 'sapgui' ) is not initial.
          concatenate page_name '&sapgui=1' into page_name.
        endif.
        if request->get_form_field( 'sapframe' ) is not initial.
          concatenate page_name '&sapframe=1' into page_name.
        endif.
        navigation->goto_page( page_name ).
        exit.
      endif.
    get page name
      page_name = mr_application->get_current_page( ).
    process input
      loop at mt_handler into ls_handler where
          eventtype ca c_validation and
        ( page_name = page_name
          or page_name = '*' ).
        method_subrc = dispatch( ls_handler ).
        add method_subrc to subrc.
      endloop.
    execute event handlers
      if subrc = 0.
        eventtype = ce_event. " normal events
      else.
        eventtype = ce_exit_event. " exit events
      endif.
      loop at mt_handler into ls_handler where
          eventtype = eventtype and
        ( event_id = event_id
          or event_id = '*' ) and
        ( page_name = page_name
          or page_name = '*' ).
      call handler when no error in PAI or exit event
        dispatch( exporting is_handler = ls_handler ).
        if eventtype = ce_exit_event and ls_handler-event_id <> '*'.
          clear subrc. " process PBO on exit event
        endif.
      endloop.
    endmethod.

  • How do I check Imy account details are correct

    I have stopped receiving emails since 10.06.14. I did recently install Google Chrome. My account details were configured automatically.

    To diagnose problems with Thunderbird, try the following:
    *Restart the operating system in '''[http://en.wikipedia.org/wiki/Safe_mode safe mode with Networking]'''. This loads only the very basics needed to start your computer while enabling an Internet connection. Click on your operating system for instructions on how to start in safe mode: [http://windows.microsoft.com/en-us/windows-8/windows-startup-settings-including-safe-mode Windows 8], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-7 Windows 7], [http://windows.microsoft.com/en-us/windows/start-computer-safe-mode#start-computer-safe-mode=windows-vista Windows Vista], [http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" Windows XP], [http://support.apple.com/kb/ht1564 OSX]
    ; If safe mode for the operating system fixes the issue, there's other software in your computer that's causing problems. Possibilities include but not limited to: AV scanning, virus/malware, background downloads such as program updates.

  • Unable to email photos, receive a statement that the server does not recognize my username and or password, have checked multiple times that these are correct

    I am unable to e-mail  photos, receive a statement saying that the werever does not recognize my username and or password. I have checked multiple times and these are correct.

    The box comes up that says "server does not recognize username or password".
    That error message usually will pop up, when there is a conflict between the "From" setting for the mail account you are sending from and the selected outgoing mail server. Probably the outgoing Mail server is receiving a user name and password it does not understand. When the mail returns unsent, do you see the "Try again" panel with the option to select a different outgoing mail server?
    If you do not see this panel, change the Mail "Preferences > General" to "If Outgoing server is unavailable: Show a list of alternate servers". This way, you will know, which server Mail is trying to send from.
    Have you tried to set "From"  pop-up menu to one of your other email addresses?  If that works, change your settings in Mail to always send from this address. You can set this option in the Mail "Preferences > Composing: Send New Messages from". I have my "Send New Messages from" set to "iCloud". That is working best for me with iPhoto.

  • Text Hyperlink states are not working correctly

    I am having an issue with the states changing correctly with text hyperlinks.  I have five on one page and they should all act the same way.  Only the first one changes correctly.

    Hi
    Can you please check that if "Edit Together" is unchecked in menu widget ? It may be the possibility that you made changes to individual menu item while edit together was unchecked.
    Also, I believe you are referring to main menu items , not sub items as they will not follow the same state defined.
    Thanks,
    Sanjit

  • HT3702 i am unable to purchase as consistently says bank details are wrong. They are correct. what could be wrong?

    i need help with something. for the past 3 months i have been travelling between Hong King and New York, I have a US itunes account that will not accept my US credit card details . "doesnt match the banks details"
    My details are correct and this message has continued to come up
    Thoughts?

    Thanks Eric for responding.
    I checked and it does not appear in the Applications folder.
    I tried yesterday on an ethernet connection with a download speed of 2 Mbps but, unfortunately the connection died(It happened from the ISP end, which is out of my control) in between after which there was no trace of the download that happened for so long(till the internet connection death). 
    One more serious query which I am unable to understand. If the internet connection, dies in the midst of the download is in progress why is it so that the state does not persist and one has to restart the entire process again. Is there no solution for this?
    I tried so many times and its the same case after some amount of download it vanishes. So many unsuccessful attempts. I am ****** off now. Is it not possible to see Mavericks? Why does different machines of Apple behave differently? Somewhere it goes smoothly and somewhere like my mine. Why did not Apple release a non apple store version? Is this not a bad sign of letting the users struggle when something is being offered for free?
    The reason I asked as whether we can download the .app of Mavericks is that, there are so many applications that I have downloaded web and have installed. All that works fine. Can't we do the same here? You download a copy of Mavericks installer application and upload it for me in Google drive or like online storage places which can be downloaded and used by me? Help me understand.
    Thanks again.

  • TS3899 Cannot send email from iPhone. Outgoing settings are correct. Checked against iPad setting which are OK and can send mail OK.

    Cannot send email from iPhone. Outgoing settings are correct. Checked them against iPad settings which are OK and can send mail. What can I do?

    For IOS7.02
    The user name and password are in two places. Make  sure they are correct in both locations.
    Settings>>Mail, Contacts, Calendars>>your email>>
    First spot is here under INCOMING MAIL SERVER
    Below this is OUTGOING MAIL SERVER
    Select: SMTP smtp.comcast.net>> PRIMARY SERVER :smtp.comcast.net>>second location of user name and password
    Here is the second place that the user name and password must be checked.
    I had changed my password in the first spot, but not the second spot. I had been receiving the same error message. This fixed my problem.

  • How can I reset my iPad YouTube password? I can't sign into youtube on iPad. It says Username or password is wrong although both are correct when I log into YouTube account via Google.

    how can I reset my iPad YouTube password? I can't sign into youtube on iPad. It says Username or password is wrong although both are correct when I log into YouTube account via Google. I also tried my husbands youtube login and password and the same outcome. Now I cant log into YouTube via the iPad account. I can log into Youtube via Google however my subscriptions and favorites are all gone. Can I reset the YouTube account located on the iPad? I cant seem to reset the password or delete the app and re-add. I dont want to reset the iPad since I have alot of videos and pictures on it.

    Do you have Google 2 stage authentication turned on?
    If so, you wont't be able to use your normal google password, but will have to instead generate an "application specific" password for the iPad YouTube app in the google security settings section.

  • Upgraded to iTunes 11. Now, I can not sync my music to my iPhone 4S (iOS 6.0.1) Apps, movies and videos sync OK. Music is the problem. Tags are correctly check-marked. Any ideas ???

    Upgraded to iTunes 11. Now, I can not sync my music to my iPhone 4S (iOS 6.0.1).  Apps, movies and videos sync OK. Music is the problem. Tags are correctly check-marked. NO ERROR MESSAGE THOUGH. Just a No Content in the Music App in the iPhone. Any ideas ???

    Bump!

  • Firefox no longer loads home page or deletes cookies. I have repeatedly checked both settings and they are correct. It always goes to the last page I was on when I closed the browser ..

    Firefox no longer loads home page or deletes cookies. I have repeatedly checked both settings and they are correct. It always goes to the last page I was on when I closed the browser .

    Go to '''TOOLS''' then''' OPTIONS''' then in '''GENERAL''' panel in '''STARTUP '''session choose '''Show my home page''', then click '''OK''' to save it, exit firefox and restart-it.
    see for more info: [https://support.mozilla.org/en-US/kb/Options%20window%20-%20General%20panel Options window - General panel]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • Hello, starting with today I have a strange problem: all events are correctly shown in the finder but in FCP-X there`s`none and every time I open it creates a new event. What is wrong?

    Hello, starting with today I have a strange problem with Final Cut Pro X: all events are correctly shown in the finder but in FCP-X there`s`none and every time I open it creates a new event. What is wrong?

    Here`s the screenshot.
    But anyway:
    The drive is Makintosh HD from my Macbook and it is shown in the event mediathek and in the projects. Since I`ve recognized this problem I installed FCPX again and consequently the event and project directory created by FCPX is where it should be and it shows all the test events including it`s files.
    So what happens? Opening FCPX you see only one event and that a new empty event. All previous events are not shown there even if you can see them in the finder. So if you import again the clips they are in this new event library. After closing correctly FCPX and reopening there again is nothing than an new and empty event. What it does is that it recognized that i.e. there are events with previous numbers and so it creates an new one with the next available counting number.
    If you want to open one event from the finder it by clicking to the file it opens FCPX but it says it cannot open the clicked file.

Maybe you are looking for

  • I didnot start my admin server here i am attaching the thread

    awt.toolkit = sun.awt.windows.WToolkit file.encoding = Cp1252 file.encoding.pkg = sun.io file.separator = \ java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment java.awt.printerjob = sun.awt.windows.WPrinterJob java.class.path = C:\WEBLOG~1\patch_

  • Purchase and Sale scenarion in TD- Error

    Hi Experts, Need help!! I am trying to run a purchase and sale scenario in TD. so while assigning a Shipment notification in TD shipment and making it load relevant, I get the following error. *Inbound delivery 180000006 item  must no be relevant for

  • How to access "Alternative Realm" or "Custom Realm" from components like Servlet ?

    Hello, Says if I have alternative realm or my custom realm which implement "ManageableRealm" interface. How can I access the realm from other component, like Servlet or EJB in same WLS ? I tried using code like this BasicRealm realm = Realm.getRealm(

  • Photo Booth compatible webcams?

    Does anyone know of any webcams that are compatible with Photo Booth and iChat? Since I have a Mac Mini, I need something 3rd party that would work since Apple no longer sells the iSight stand-alone. Any advice?

  • Lightroom 4.2 export problem

    When I try to export images as jpeg's, Lightroom 4.2 shows the progress bar indicating the images are being exported.  When exporting is completed, I get an error popup that LR cannot update the original RAW files.  The originals are read-only, as th