need help to write correct code for nested button

This is the code in the main timeline.

Stop();

garage.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

function mouseDownHandler(event:MouseEvent):void {}

gotoAndPlay ("open");

}

The movieClip gDoor is nested inside the garage and 'open' is a label on this chronology.  I know that the gotoAndPlay ("open"); is not correct.  How would be the label on nested timeline.

the link below is to download the FLA

clienttestsite.X10.MX/beta/garage.fla

The problem is that you have an event listener assigned to the garage, which is block / casting interaction with what anyone inside.  When you click the button on the chest, you are always clicking on the garage, making the gotoAndPlay("open")... where he stops to the stop();

One way around this problem is to assign an instance name to the door and to assign the code to open to...

Stop();
garage.door.addEventListener (MouseEvent.CLICK, openHandler);
function openHandler(event:MouseEvent):void {}
garage. Play();
}

garage.chest.closeBtn.addEventListener (MouseEvent.CLICK, closeHandler);
function closeHandler(event:MouseEvent):void {}
garage.gotoAndPlay ("close");
}

Note: as shown in the code above...

-Use the CLICK instead of MOUSE_DOWN.

-in the openHandler use play() instead of gotoAndPlay ("open"). You are already in the 'open' setting, and it is only because the stop() is exhausted only it actuallys works.

Do what I explained above also makes so that you can click on the door to close it that way.

Tags: Adobe Animate

Similar Questions

  • need help to modify the code for the timer

    Hello

    I hope that it's fairly easy. I have a code for a timer that counts down 60 seconds. So to start the countdown, a start button is pressed and once the countdown starts, there is a stop button. I want to change the code so that the timer starts automatically (I will be embedding in a web page). I know that to hide a button, I just need changevisible = true, visible = false. I basically just need to know hot to start automatically.

    Code in force here.

    clock_val = '60: 00.
    _root.old_time = '0 '.

    fscommand ("ShowMenu", "false")

    my_milli = 0
    old_time = 0

    function is_digit (x) {}
    var numbers = "0123456789".
    If (digit. IndexOf (x) > = 0) {}
    Returns true
    } else {}
    return false
    }
    }
    function first_digit_bunch (x) {}
    var x_len = x.length
    var xresult = «»
    var yresult = «»
    var xmode = 0
    var count_3 = 0
    for (i = 0; i < x_len; i ++) {}
    xchar var = x.charAt (i)

    if(xMode == 0) {}
    {if (is_digit (Xchar))}
    xMode = 1
    }
    }

    if(xMode == 1) {}
    {if (is_digit (Xchar))}
    xResult += xchar
    } else {}
    xMode = 2
    }
    }

    if(xMode == 2) {}
    If (xchar == ":") {} ")
    xMode = 3
    count_3 = I have
    } else {}
    xMode = 9
    }
    }
    If (xmode == 3 & & I > count_3) {}
    {if (is_digit (Xchar))}
    yresult += xchar
    } else {}
    xMode = 4
    }
    }

    }
    If (xresult == "") {}
    xResult = '0 '.
    }
    If (yresult == "") {}
    yresult = '0 '.
    }
    var zresult = Math.round (parseFloat (xresult) * + impose_range (parseFloat (yresult), 0, 59.99) 60) / 60
    return zresult
    }
    function extract_min() {}
    minutes0 var
    {if(!_root.is_set)}
    minutes0 = 5
    _root.num_minutes = 5
    _root.is_set = true
    } else {}

    If (_root.paused_time! = clock_val) {//edited
    minutes0 = first_digit_bunch (clock_val)
    //}
    } else {}
    minutes0 = _root.num_minutes
    }
    If (minutes0 < = 0) {}
    minutes0 = _root.num_minutes / / reset to the last value
    }
    minutes0 = impose_range (minutes0, 0, 99.99)
    _root.num_minutes = minutes0
    _root.num_seconds = _root.num_minutes * 60
    display_time()
    }

    function startTimer() {}
    extract_min()
    stopTimer()
    _root.milli_value = my_date.getTime)
    _root.my_milli = (new Date()) .getTime)
    _root.old_time = _root.my_milli
    btn_stop._visible = true
    btn_start._visible = false
    msg_stopped._visible = false
    _root ["timer0" + xmodule] .gotoAndPlay (2)
    _root ["timer00"] .gotoAndPlay (2)
    }
    stopTimer() {} function
    clock_val = _root.num_minutes + ": 00".
    stopTimer0()
    extract_min()

    }
    function stopTimer0() {}
    _root.timer00.gotoAndStop (1)
    display_time()
    btn_stop._visible = false
    btn_start._visible = true
    times_up._visible = false
    msg_stopped._visible = true
    _root.paused_time = clock_val
    _root.timer01.stop)
    _root.timer02.stop)
    _root.timer03.stop)
    }

    function endTimer() {}
    stopTimer()
    times_up._visible = true
    msg_stopped._visible = false
    the_audio.gotoAndPlay (2)
    }

    function decrement_seconds() {}
    _root.num_seconds-
    _root.old_time = _root.my_milli
    if(_root.my_milli == 0) {}
    _root.my_milli = (new Date()) .getTime)
    }
    _root.my_milli = (new Date()) .getTime)
    var my_diff = _root.my_milli - _root.old_time
    num_seconds-= (my_diff/1000)
    Alert ("num_seconds =" + num_seconds)

    }

    function calc_time (cur_frame, end_frame) {}
    var frames_remaining = end_frame - cur_frame
    var secs_remaining = _root.num_seconds //frames_remaining / 5 / / assuming that the fps is 5
    trace ("secs_remaining =" + secs_remaining)
    var display_result = seconds_to_minsec (secs_remaining)
    return display_result
    }
    function impose_range (x, lower, upper) {}
    if(x < Lower) {}
    lower back
    }
    if(x > Upper) {}
    back to top
    }
    return x
    }
    function (dry) seconds_to_minsec {}
    var mins_val = Math.floor(secs / 60)

    mins_val = impose_range (mins_val, 0, 99.99)

    var secs_val = Math.floor (seconds % 60)
    secs_val = impose_range (secs_val, 0, 59)
    var result = x_digit_string(mins_val,2) + ': ' + x_digit_string(secs_val,2)
    trace ("result =" + result)
    Returns the result
    }

    function x_digit_string (JNombre, x) {}
    no worry about more than numbers 999 or negative numbers
    var vstring = String (JNombre)
    return x_fill_zero (vstring, x)
    }


    function x_fill_zero (str, len) {}
    will not shorten
    var len = vresult_length
    var vstring_length = str.length
    var distance = vresult_length-vstring_length
    var vresult = str
    for (var i = 0; I < gap; i ++) {}
    vresult = '0' + vresult
    }
    return vresult
    }


    function start_timer_begin_exam() {}
    _root.controller9.gotoAndStop ("Start")
    //}

    function display_time() {}
    var clock_hexagesimal = calc_time(_root.num_seconds,_root.num_minutes*60)
    _root.clock_val = clock_hexagesimal
    trace (clock_hexagesimal)
    clock_num = clock_num + 1
    }

    You must remove the onENterFrame activity: delete onEnterFrame;

  • Need help to write a program for the acquisition of signals.

    Hello

    I need to write a program that will do the following:

    1 acquire two signals simulated,

    2. make 10 averages the signal,

    3. filter the signal,

    4. display the signal in its raw form and the power spectrum (fft),

    5. save the data using writing to the file vi

    I tried it for awhile, but there's always something does not... None of the experts LabVIEW here can help me?

    Thank you 1 million.

    -Deet

    No one here is going to do your homework for you. Please join what you have written so far and explain the specific problem that you are experiencing.

  • need help to write sql code

    Hi all

    I need to write a sql that retrieves data from the status table and check for this time in the ESHIFT table if the flag was or not. If is there, then it will keep the record as it is Furthermore, there

    did not understand at the time the flag was N suppose ESHIFT table has one record where you N 13:00:01-13:30 then the status register which is 13:00-13:59 min 59 s, we should get 13:00 - 13: records of 00:00 1 and 2 of 13:30:01-13:59 min 59 s

    create table ESHIFT (From_date date, date, to_date, flag varchar2 (2));

    insert into ESHIFT values (' 1 February 12 09:00 ", February 1, 12 13:20 ', 'Y');

    insert into ESHIFT values (' 1 February 12 13:20:01 ", 1 February 12 13:30 ',' don't);

    insert into ESHIFT values (' 1 February 12 13:30:01 ", February 1, 12 16:00 ', 'Y');

    SELECT * from eshift;

    create table status (date of From_date, to_date date, status number);

    insert into values of status (1 February 12 11:00 ', February 1, 12 12:00 ', 1);

    insert into values of status (1 February 12 12:00:01 ', February 1, 12 12:20 ', 2);

    insert into status values ("1 February 12 12:20:01", 1 February 12 12:59:59 ', 1);

    insert into status values ("1 February 12 13:00", February 1, 12 13:59:59 ', 1);

    insert into status values ("1 February 12 14:00", February 1, 12 14:59:59 ', 2);

    SELECT * STATUS;

    In the case above should get sql

    1 FEBRUARY 12 11:00 1ST FEBRUARY 12 12:00 1

    FEBRUARY 1ST, 12 12:00 1ST FEBRUARY 12 12:20 2

    FEBRUARY 1ST, 12 12:20:01, 1 FEBRUARY 12 12:59:59 1

    FEBRUARY 1ST, 12 13:00 1ST FEBRUARY 12 13:20 1

    FEBRUARY 1ST, 12 13:30 1 FEBRUARY 12 13:59:59 1

    FEBRUARY 1ST, 12 14:00 1 FEBRUARY 12 14:59:59 2

    It will be really great if someone can help me how I can get the desired result.

    Thank you very much in advance.

    Please provide instructions creating table and data. It makes it so much easier to answer.

    I think you want:

    Select (s.from_date, e.from_date) greatest from_date, less (s.to_date, e.to_date) to_date, s.status

    s status e eshift join on s.from_date < e.to_date="" and="" s.to_date=""> e.from_date and e.flag = 'Y '.

    order by 1

  • Need to find the correct reference for replacement screen Aspire 5742

    Hello

    I need to find the correct part for replacement screen Aspire 5742.  The backlight does not work anymore, and I already bought a UPS to see that this model/version does not use a UPS (as the backlight is LED and integrated in the element of the screen).  I find the somewhat confusing model numbers table.  The full model version seems to be:

    5742 - 464G50Mnnk

    S/N: [redacted to comply with guidelines]

    SNID [redacted to comply with guidelines]

    This seems to be a very good laptop that belongs to a mine Guigou, but not worth repair at the local dealership, and I'm sure I can replace the screen myself if I can get the right part, having already dismantled the set of sieves and to be an electronic engineer.

    Either way, I guess that this version of model is the 5742, not the 5742 G (even if the model number has a 'G' in it: some of the confusion).  Any help would be appreciated.

    Part numbers for the 15.6 TFT LCD for the Aspire 5742 are:

    LK.15605.004
    LK.15605.010
    LK.15606.009
    LK.15608.007
    LK.15608.011
    LK.1560A.004
    LK.1560D.010
    LK.1560E.004
    LK.15605.019
    LK.15606.012

  • I need help to write a script that detects the first instance of a paragraph style and then change

    I need help to write a script that detects the first instance of a paragraph style and then he goes to a different paragraph style.  I don't necessarily need someone to write all this, by the biggest problem is to find how to find just the first instance of the paragraph style.  Any help would be greatly appreciated, thank you!

    Hello

    then try this with your active doc:

    ....................

    myDoc var = app.activeDocument;

    mStyle var = myDoc.paragraphStyles.item ("PS_NameToFind"); change the name to paraStyle

    var mStyle_1 = myDoc.paragraphStyles.item ("PS_NameToChange"); change the name to paraStyle

    var mFrames = myDoc.pages.everyItem ().textFrames.everyItem () .getElements ();

    app.findTextPreferences = null;

    app.findTextPreferences.appliedParagraphStyle = mStyle;

    for (var k = 0; k)< mframes.length;="">

    {

    currFound = mFrames [k] .findText ();

    If (currFound.length > 0)

    currFound [0] .paragraphs [0] .appliedParagraphStyle = mStyle_1;

    }

    app.findTextPreferences = null;

    ................

    Rgds

  • Need help to write a sub query

    Our environment - Oracle 10 g

    Hi all
    Need help to write a sub query to reach him here are examples of data using which iam trying to replace the value column in the table based on two other columns in the same table

    Examples of data

    ClaimNo flag LineNo Procedurecode
    100 01 N MN4567
    100 02 Y 7863
    100 03 N MN8976
    100 04 Y 9000
    101 01 Y 8954
    101 02 N MN6754
    101 03 N MN7654
    101 04 Y 8976
    102 01 Y 1234
    102 02 Y 2345
    102 03 Y 3456
    102 03 Y 4567

    Each column of ClaimNo has several rows of data. But if column procedurecode for a claimNo starts with MN then all values associated with the claimno for the flag column should replace N

    If the data must become like below

    ClaimNo flag LineNo Procedurecode
    100 01 N MN4567
    100 02 N 7863
    100 03 N MN8976
    100 04 N 9000
    101 01 N 8954
    101 02 N MN6754
    101 03 N MN7654
    101 04 N 8976
    102 01 Y 1234
    102 02 Y 2345
    102 03 Y 3456
    102 03 Y 4567


    Thank you

    See the example:

    with t as (
                  select 100 ClaimNo, '01' LineNo, 'N' Flag, 'MN4567' Procedurecode from dual
        union all select 100, '02', 'Y', '7863' from dual
        union all select 100, '03', 'N', 'MN8976' from dual
        union all select 100, '04', 'Y', '9000' from dual
        union all select 101, '01', 'Y', '8954' from dual
        union all select 101, '02', 'N', 'MN6754' from dual
        union all select 101, '03', 'N', 'MN7654' from dual
        union all select 101, '04', 'Y', '8976' from dual
        union all select 102, '01', 'Y', '1234' from dual
        union all select 102, '02', 'Y', '2345' from dual
        union all select 102, '03', 'Y', '3456' from dual
        union all select 102, '03', 'Y', '4567' from dual
    )
    select
        claimno,
        lineno,
        flag,
        case
          when count(decode(substr(procedurecode,1,2),'MN',1)) over(partition by claimno)>0
            then 'N'
          else flag
        end new_flag,
        procedurecode
    from t
    

    Kind regards
    Sayan M.

  • I need help to install adobe flash for my G5 mac

    I need help to install adobe flash for my MAC OS X 10.4.11, I visited site and its telling me to upgrade my adobe flash, I really need help.

    Flash Player should be installed ONLY from the Adobe Web site.

    Here you can check which version of Flash player you have actually installed: http://kb2.adobe.com/cps/155/tn_15507.html

    You can check here: http://www.adobe.com/products/flash/about/ to see what version you need to install to your Mac and OS. You must first uninstall any old version of Flash Player using uninstaller from here (make sure you use the right pair!):

    http://kb2.Adobe.com/CPS/909/cpsid_90906.html

    and also that you follow the instructions carefully, as all applications (including Safari) closed first before installing. It is strongly recommended that you perform a permissions repair after installing anything from Adobe.

    After installation, restart your Mac and restart Safari, then in Safari/security preferences enable "enable Plugins".

  • URGENT! need help DRIVER HP Pavilion P6230L for Windows XP Pro

    Dear helpdesk,

    URGENT! need help DRIVER HP Pavilion P6230L for Windows XP Pro...

    Send me the link for the driver or compatible.

    or email to: [email removed for privacy]

    Kind regards

    MRZ

    Message edited by SandyD on 25/11/2009 14:01

    Thank you

    but I can't download link for LAN

    FTP://ftp.HP.com/pub/softlib/software10/COL30407/PV-75371-1/sp44423.exe is not available.

    and I need driver motherboard chipset

    Help me.

    MRZ

  • I need help, downloaded adobe flash player for windows 7

    I need help, downloaded adobe flash player for firefox windows 7. I download, I click Run and there is just a small black screen that says on the top of the page install adobe flash player but nothing happens after that. This small screen stays like that for hours maybe days. I tried troubleshooting but nothing seems to work. What can I do? How can I get the installation of the program?

    Use the installation offline programs:

    [topic moved to the forum of Flash Player]

  • I am a newbie to this and I was wondering how to write CSS Code for text, text color, size text and text effects...

    Please keep in mind that I am a newbie. For the moment, I don't know how to write code, so I use Muse to try to build a Web site that is not super fancy writing know, then improve or build or create a new site later. I called Adobe and they said someone in the forums may know how to write code and that he could help me. That said, if someone could answer my questions and help me somehow, I'd be really grateful.

    1. How can I write code, what code should I write to

    Text?

    Color of the text?

    Text size?

    Text/Font Style

    Text effects (such as fly in or fly out, bounce in and out bounce, spin in and spin out, fade in and fade out, etc)?

    Direction of text effect?

    Time that the effect occurs, if it is applied, initiated, comes in? example fly in or fade?

    Time than the last.

    After the effect stops, turns off? example: fly away or fade out?

    2. how to enter the code Muse?

    3. should I have a program to write the code?

    4. is there a function I could use on my computer, such as Notepad, to write the code, copy and paste it into Muse?

    5. What is the best book or books to learn how to write css, code and everything I need to do to be able to do the above and more?

    6. is there anything else I need to know or do to be able to do these things with the text?

    You can find more information on the style of your text (paragraphs, titles, etc. in some of the tutorials here: TUTORIALS |) Adobe Muse CC

    You can also check out tutorials on this page for scrolling effects that can do some of the other effects you need. Without exactly knowing your use case it's hard to give specific advice.

    Basically if it is not covered undressed under the text, scrolling Effects tutorials or in a third party widget already made, then you will need to create it yourself using CSS. You will need to use some sort of browser Firebug like developer tools in Firefox to find the ID of the element you want to add the CSS to write the CSS code and insert it into the head section of the page properties.

  • need help to write a conditional query recordset

    I have two fields or not in the database. VeteranMarker and VeteranNoMarker. Answering one can be Y or N.
    I want to write a statement for my detail page where there is a label "veteran? If VeteranMarker or VeteranNoMarker has a Y in the database, then I want to display "YES" next to the label of "veteran? If neither has a Y, then I want to say 'NO '.

    The recordset is called DetailRS1, the fields would be so (I think) DetailRS1.VeteranMarker and DetailRS1.VeteranNoMarker.

    I have no idea how to write a conditional statement to achieve this.

    Thanks in advance,
    Miriam

    I think I have it solved. Here is the code, and it seems to work. If this is correct, I hope it can help someone else too.

  • HP Pavilion Notebook - 15-p233: need help to reset the password for notebook 15 "pavilion

    I need to reset the password for pavilion notebook 15 "15 p 233

    could you please help

    The error code generated after that 3 test is 687 47 264

    Thanks for your help!

    @simpleuser001

    Enter: 77625860

    Kind regards

    DP - K

  • Need help with the port forwarding for a XBox remote Streaming

    I have a router R6200v2 and need help with port forwarding.

    I came across this set of instructions for setting up stream port forwarding XBox remotely from anywhere

    http://kinkeadtech.com/2015/07/how-to-stream-Xbox-one-to-Windows-10-from-anywhere-with-Internet/

    I have no idea when it comes to such things and I want to make sure I do it correctly without messing up my existing home network.

    Port Forwarding and triggering Port pages setup look very different from what the guy uses. Can someone walk me through what I do to set up please?

    Hi @varxtis,

    You must enter them in the field for a start external Port and external completion Port. You will need to send individually except for the range of 49000-65000. The steps are as follows.

    1. create a Service name (it could be something else that you cannot use the same service name twice. Ex. XBOX1, XBOX2 and so forth.)

    2. Select the type of service (TCP, UDP or both)

    3 entry 5050 times a start external Port and external endpoints.

    4. Select the IP address of your XBOX.

    5. Select apply.

    6 do the same for other port numbers. To the beach, use 49000 for the external departure Port and for the external completion Port 65000.

    Kind regards

    Dexter

    The community team

  • Need help with SQL/PL/SQL for Dates

    Hi Experts - need help with a SQL query.

    I need to insert some date fields in a table called CALENDAR_PERIOD.

    Current data in CALENDAR_PERIOD table with their data types:

    STARTPERIOD (DATE) YEAR (NUMBER) PERIOD_LABEL (Varchar2 255)

    02/11/2014 2014 2014/02/11 SUN

    03/11/2014 2014 14/03/11 MON

    04/11/2014 2014 11/04/14 MAR

    I have to increment above values up to the year 2025. I don't know how to write SQL and increment of these values.

    Ex: My next value should insert: 05/11/2015 2014 11/05/14 WED like that I need to insert data until 12 31, 2025.

    Can you please help me with PL/SQL block?

    Really appreciate your help!

    DB version:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Thank you
    Sandy

    Hello Sandy,

    Maybe something like

    INSERT INTO calendar_period (startperiod, year, period_label)

    SELECT DATE '' 2014-11-04 + LEVEL

    , TO_NUMBER (TO_CHAR (DATE '' 2014-11-04 + LEVEL, "YYYY"))

    , TO_CHAR (DATE '' 2014-11-04 + LEVEL, "MM/DD/YY DY")

    OF the double

    CONNECT BY LEVEL<= date="" '2025-12-314="" -="" date="">

    ;

    ((mais je ne comprends pas pourquoi nous créons une telle table "année" et "period_label" peuvent être calculé à partir de startperiod))

    Best regards

    Bruno Vroman.

Maybe you are looking for

  • In a pinned tab - how to force the link click here to open in a new tab?

    I'm trying to get all THE links you click to open in a new TAB. It worked before the upgrade to v37.0.02 wonder, but I started to notice some links are now updated the TAB PINS, rather than open the link in a new tab. Only some. All of these sites th

  • Satellite Pro C850-1FN stucks in the form of preparation of auto repair

    Hello I have a Satellite Pro C850 1FN and for some reason it stuck in a display of automatic preparation for startup repair. He will be sitting with the text on the screen, and after 8 minutes bluescreen shows then talk about a problem and then re bo

  • ASR backup on laptop Satellite series

    Since the machine has no internal floppy drive, I used a USB FDD to ASR backup. The main backup is located on a USB HDD and the recovery disc has been created in the USB FDD. When you try to use the ASR utility to restore the system to a new HARD dis

  • nuancepdf, who is heard of him?

    It's on my desk and I have not installed it.  I clicked it and it says it monitors Web sites and prevents them from getting your information.  Is it not the same thing as the other antispyware programs?  I said that if a program is installed on your

  • System ID: estimated incompatibility of response and simulation

    I use the VI express Estimation of transfer function SO to model a system plant transfer function. The actual data are a step response, where the stimulus is a flow rate report, and the answer is the size of the droplets resulting (it is a system of