Call syntax on the variable movie in its parent sheet

I know that my syntax is wrong based on the error I get, but I can't figure any other way to do this:

Code:

var menuButtons:Array = ["home", 'liveIntense', 'liveAblaze', 'liveBright', 'liveClean', 'about', "co ntact", "shirts", "know", "stickers", "blog"];

for (var i: uint = 0; i < menuButtons.length; i ++) {}

addButtonListeners (menuButtons [i], menuButtons_mc, clickF);

}

function addButtonListeners(buttonName:String,buttonParent:MovieClip,clickFunction:Function):void {}

var button = new buttonParent_mc();

buttonParent.addChild (button);

Button.x is buttonParent.this [+ ButtonName "_btn"] .x;.

Button.y is buttonParent.this [+ ButtonName "_btn"] there;.

buttonParent.this [+ buttonName "_btn"] .visible = false;

}

Output:

1084: syntax error: expecting identifier before that.

I know that the issue is here: buttonParent.this [+ buttonName "_btn"] .x

How can I call on moveiclips with different names that are in another clip of film?

Thank you!

use:

var menuButtons:Array = ["home", 'liveIntense', 'liveAblaze', 'liveBright', 'li veClean', 'about', 'contact', 'shirts', 'SOAP', 'stickers', 'blog'];

for (var i: uint = 0; i

addButtonListeners (menuButtons [i], menuButtons_mc, clickF);

}

function addButtonListeners(buttonName:String,buttonParent:MovieClip,clickFunc_tion:Function):void {}

var button = new buttonParent_mc();

buttonParent.addChild (button);

Button.x is buttonParent [+ ButtonName "_btn"] .x;.

Button.y is buttonParent [+ ButtonName "_btn"] there;.

buttonParent [buttonName + '_btn'] .visible = false;

}

Tags: Adobe Animate

Similar Questions

  • Screen is scrolling down repeatedly and the cursor moves on its own.

    The cursor is rolling along of type I.m

    You do not give much information about what is really happening, but the first two points to check are the mouse and the keyboard, before looking for other hardware or software problems.

    If you have another mouse and keyboard available, you can try reverse the two and restart the computer to see if the problem persists.  If not a little more information would be needed before I could give advice on the best way to solve the problem.

    You're talking about the screen, scroll down and the cursor moving without the mouse - these are two separate actions.

    He is not anywhere on the screen do scroll down unless you have a running program - this scrolling happens with all programs that could scroll, or simply with a certain program?

    The cursor moves randomly or according to a specific orientation?  The cursor move around all the time or only in certain programs?

    These problems occur all the time, or only when you do something, like click with the mouse or use the scroll wheel?

  • How to read a variable main.swf (this content.swf of load) and use within the loaded movie?

    Hello

    How to read a variable main.swf (this content.swf of load) and use it within the content.swf?

    I have a variable called TextColor = 'Green' handmade film and I want to read this variable from inside the content movie?

    anyone can help!

    Thank you very much.

    MyGiantBrain thanks for your reply but kglad method worked very well.

    Thanks kglad but there is some changes to your code so that it works, and it is:

    trace (MovieClip (parent.parent) ["TextColor"]);

    Thank you

  • How should I correctly call ESXi 4.1 variable kickstart in the firstboot % section?

    I have adjustments with a new article that I added to a kickstart file.  The new article is supposed to retrieve the MAC address for vmnic0, then grep MAC address of a file to get the name of the server host and other IP addresses.

    It defines the variable MAC address successfully, but other variables don't settle for some reason any.  This is verified by the /etc/variables.txt file I write values in.  The MAC address is in the file and followed by 4 carriage returns.

    So why call the variables work in the section with the echo commands, but not when it is used by setting the variables?

    ########################## BEGIN ks.cfg ##################################
    vmaccepteula
    Autopart - firstdisk = local - overwritevmfs
    rootpw - iscrypted 1234567 & & &
    network - bootproto = dhcp - device = vmnic0 - addvmportgroup = 0

    # Restart after installation
    reset

    # We set up some basic things when you first start the command line before adding the host to vCenter
    firstboot % - not supported - interpreter = busybox

    # Get IP address for host Info
    CD/tmp

    # Define variables
    VMNIC0_MAC ='esxcfg-NICS - l | grep vmnic0 | AWK ' {print $7} "
    HOSTNAME ='grep $VMNIC0_MAC vmknic_table | AWK f «;» {' print $1' '}'
    IPADDR = "grep $HOSTNAME vmknic_table |" grep $HOSTNAME | AWK f «;» {' print $2' '}'
    VMK_VMOTION ='grep $HOSTNAME vmknic_table | grep $HOSTNAME | AWK f «;» {' print $3' '}'
    VMK_NFS01 ='grep $HOSTNAME vmknic_table | grep $HOSTNAME | AWK f «;» {' print $4' '}'

    echo $VMNIC0_MAC > > /etc/variables.txt
    echo $HOSTNAME > > /etc/variables.txt
    echo $IPADDR > > /etc/variables.txt
    echo $VMK_VMOTION > > /etc/variables.txt
    echo $VMK_NFS01 > > /etc/variables.txt

    # Configure the name of host, IP address, DNS servers, and gateway
    Vim - cmd hostsvc/net/dns_set - hostname = $HOSTNAME - domainname = ourdomain .net - ip-addresses = 10.10.10.1, 10.10.10.2 - searchdomain = ourdomain .net
    esxcfg-vmknic - i $IPADDR - n 255.255.255.128 "network management".
    esxcfg-road 10.10.10.129

    # Wait to make sure that everything was created and update the network stack
    sleep 5
    Vim - cmd hostsvc/net/refreshment
    ########################## END ks.cfg ##################################

    # BEGIN vmknic_table #.
    ESX01; 10.10.10.177; 10.10.11.17; 10.10.10.17; this: bf:a2:1f:12:9 has
    esx02; 10.10.10.178; 10.10.11.18; 10.10.10.18; this: bf:a2:1f:12:9 b
    esx03; 10.10.10.179; 10.10.11.19; 10.10.10.19; this: bf:a2:1f:12:9 c
    ########################## END vmknic_table #############################

    Seems I have fixed my problem here.

    A couple of notes:

    First OFF... by setting my variables, I had a few redundant grep commands in there.  Was not cause anything to fail, but just make note.

    Secondly, the section 'network - bootproto = dhcp - device = vmnic0 - addvmportgroup = 0' seems to have been the culprit.  I can't say exactly where it was originally my script to fail, but if you use DHCP, the server received different DNS servers that caused the script to fail.  I tried to use IP addresses instead of that in my line of wget, but it still fails.  The newspapers did not help to me clue as to why it is produced either.  Quite bizarre.

    In any case, I decided to just change the line to use a "dummy" host name and IP address, then run a change of address and hostname IP later based on the txt file that lists the IP addresses.

  • How to call the variables of the scene inside movieClips

    How to call the variables of the scene inside movieClips

    One way would be to use "MovieClip (root)" to target variables in the main timeline... MovieClip (root) .someVariable = someValue;

  • Using the variable string quickly calling several variables

    OK, I'm not entirely sure how to explain it, but I will do my best...

    I have had several similar Boolean variables which are publicly declared at the beginning of my class.

    for example

    public var _ball0_mcPlaced:Boolean = false;
    public var _ball1_mcPlaced:Boolean = false;
    public var _ball2_mcPlaced:Boolean = false; 

    This will determine whether or not a particular ball was placed in a target area.

    Now I want to use this variable again in a function... However, I do not want to write in the variable for each ball in the service.

    Is there a faster way to access this variable by using a string inside the function varibale?  Each ball becomes a target of the event if clicked, so I could use something like...

    ("_" + event.target.name + "Placé") to create the dependent variable on which ball is selected?
    So, if ball0_mc is selected it returns the _ball0_mcPlaced variable?

    How can I do this?


    See you soon

    It would be written using the array notation in the form of...

    ["_" + event.target.name + "Placé"] = true;

  • In the variable name variable

    Hi guys/girls.

    I have a problem, I have a number of tables of items called "pres1", 'pres2', 'pres3', etc.

    I have a variable which will be 1, 2, 3...

    the amount of the variable goes up will always be the same amount as the number in the name of the table. That is to say if the berries go up to "pres6" the variable will go does not exceed 6

    I want to access the data in my table based on the currently set number variable

    IE: If myVar = 2, I want to access the data in "pres2.

    I'm sure that its probably something very simple and im just getting the syntax wrong, can anyone help?

    Thanks in advance

    If press1, press2, etc. are names of variables in the current scope, use:

    trace (this ["press" + myVar] [1]);

  • How to cut the great movie for download on YouTube

    In my Finder, in all the films, there is a video, I want to send on YouTube.  However, the original is very big at 1.64 GB (or at least that's what says "Get Info" in the Finder).  I already tried to divide the movie into 4 parts using the Trim function, but even in this case, each segment is between 300 and 420 MB each!

    Is there an easy way to divide the film into several parts, each of them being the maximum size accepted by YouTube?  I could call and then with part # s for download on YouTube. Not sure, but I think that YouTube has a max of 25 MB per upload to film?  So I guess I'll end up with way too many pieces, LOL.

    I could erase parts of the film strip, but I'm not familiar with the process and have "cut" never the movie of "front-end" or the "back-end" (well Yes, I said, I'm not an expert).   Bottom line: I want to get the movie in its entirety on YouTube somehow.

    All advice welcome.  The film is already 4 years old and I did not understand this in order to share with the family.

    R

    https://search.Yahoo.com/search?p=compressing%20video%20Files%20mac

    How about do your own research online for the You Tube tutorials for how to use the iMovie version you have on your OS X 10.6.8 iMac and how to edit clips make movies shorter and weaker in the size of the file.

    The discussions and the answers you need are too detailed tedious to cover in a forum for troubleshooting.

    A lot of YouTube videos for you help with your film questions of edition.

    You just need to look for the tutorial iMovie, you need.

    You had 4 years to do your own research on how to change your own created movies.

    YouTube has a lot of video tutorials to help you with this, and you can play these video the long while real using iMovie to make the tutorial!

    Good luck to you.

  • TestStand 2012 keeps the value of the variable

    I have a problem with TestStand 2012 that preserves the value of the variable. I have a step and its parameters in the string variable. I use the expression step as Step.Settings += "00". I run the sequence under sequential model and the problem is that Step.Settings is equal to "00" on the first run, '0000' on the second throw, '000000' on the third race and so forth, but it must rest '00' on each race. I can't find the root cause. Anyone has the same problem and can advice how to solve?

    Try to uncheck the properties of the sequence > optimize reentrant calls to this sequence to the sequence that contains the step.

  • Call Oracle procedure with variable

    Experts,

    I pass arguments through script to Oracle procedure, use the input value and pass to the procedure.

    Oracle procedure Gets the input value, run the query, and all connect to the log file.

    I am facing a few challenges, seems to be the error of syntax or data type

    1. even if I pass all the script parameter still run complains of wrong number or type of arguments.

    There are three numbers followed by a date variable

    2. how to pass a variable value with the INTERVAL function, it should take the value of the variable lThird for example "" AND date > = date + INTERVAL '30' MINUTE; "but somehow, after trying different variants still get error like interavl not valid."

    3 see someone more changes to this?

    ! / bin/ksh

    $1 = 10;

    $2 = 30;

    3 = $50

    $4 = '20150113';

    echo "Oracle procedure in progress"

    (

    set linesize 100

    pkg.proc exec ($1, $2, $3, $4);

    ) > $logFile

    If [$? == 0]

    then

    EXIT_VAL = 0

    = Package/oracle procedure =.

    CREATE or REPLACE PACKAGE pkg

    AS

    procedure proc (lFirst in number,

    lSecond in numbers

    lThird in numbers

    date IN oven,

    curReturn to sys_refcursor);

    Pkg of END;

    /

    CREATE or REPLACE PACKAGE pkg BODY

    AS

    PROCEDURE proc (lFirst in number,

    lSecond in numbers

    lThird in numbers

    date IN oven,

    curReturn ON sys_refcursor)

    IS

    BEGIN

    OPEN FOR CurReturn

    SELECT date,

    emp_id,

    first name,

    last_name

    Employees

    WHERE Emp_id in (lFirst, lSecond)

    Date AND > = date + MINUTE INTERVAL "(lThird)"

    AND date = TO_DATE (oven, 'YYYYMMDD')-1;

    END proc;

    Pkg of END;

    /

    Error:

    PLS-306: wrong number or types of argument in the call to proc

    Hello

    With regard to your needs:

    My current problem is

    1. how to store the SELECT results in the log file, ask has several columns with multiple lines

    2. what happens when SELECT brings out no line?

    I have re-used, corrected and adapted to your procedure:

    Package:

    CREATE or REPLACE PACKAGE pkg

    AS

    PROCEDURE proc (lFirst in number,

    lSecond in numbers

    lThird IN varchar2,

    curReturn to sys_refcursor);

    Pkg of END;

    /

    CREATE or REPLACE PACKAGE pkg BODY

    AS

    PROCEDURE proc (lFirst in number,

    lSecond in numbers

    lThird IN varchar2,

    curReturn ON sys_refcursor)

    IS

    BEGIN

    OPEN FOR CurReturn

    SELECT *.

    WCP

    WHERE empno in (lFirst, lSecond)

    AND hiredate > = TO_DATE (lThird, 'YYYYMMDD');

    END proc;

    Pkg of END;

    /

    Shell script: test_sql.sh

    #! / bin/ksh

    V_user = scott

    V_pass = Tiger

    echo "Oracle procedure in progress"

    Req ='sqlplus-s $V_user / $V_pass<>

    var refcursor rc

    exec pkg.proc ($1, $2, $3,: rc)

    print the rc

    output

    EXPRESSIONS OF FOLKLORE"

    echo "$req" > logfile$ $

    PS:

    (1) you must put the name of your user/passwd name and table (I used the scott/tiger schema by default with emp table). This is just to show how to retrieve a refcursor output in a script.

    (2) I used logfile$ $ as output file; You can use any other file or method name to redirect the output to a file

    Call us at:

    19000101 7934 7900 test_sql.sh

    PS: As noted in the previous posts, you cannot define a VARIABLE of type DATE in sqlplus (or a Unix script); You can send a string and perform the conversion in the SQL section.

    If no line is not recovered, you get the following in the log file:

    PL/SQL procedure successfully completed.
    
    no rows selected
    

    HTH.

  • Problems of syntax with a Variable/function/procedure

    Hello
    Some time ago I had advice how to define a simple (not stored) procedure within a PL/SQL Script, see procedure but not stored now, I tried to expand the sample by the use of some additional variables and a function instead of a procedure. The result expected from the following (pseudo) - code is very clear, but I get tons of errors due to problems of syntax. Of course I don't have need of all these variables in the example below, but it's the syntax I will need later. Maybe you can point me to an example which has a similar structure.

    DECLARE  
    
        -- Output Comment and 2*Input
        PROCEDURE OutputDouble(SingleValue IN Number, MyComment IN VARCHAR) IS
            variable MyTextResult VARCHAR(100); 
        BEGIN
            SELECT MyComment || ' ' || to_char(2 * SingleValue)) into MyTextResult from dual;
            dbms_output.put_line(MyResult);
        END;
        
        -- Return Product of Val1 and Val2
        FUNCTION MyProduct(Val1 IN NUMBER, Val2 IN NUMBER) IS
            variable MyNumResult Number := 0;
            returns Number
        BEGIN
            MyNumResult := Val1 *Val2;
            return MyNumResult;
        END;
    
       -- Definitions
       variable MyRes  Number;
       variable MyVal3 Number := 3;
       variable MyTxt3 VARCHAR(30) := 'Text mit 3';
     
    BEGIN
        
        -- Main process block
        OutputDouble(MyVal3, MyTxt3);
        MyRes = MyProduct(MyVal3, 5);
        dbms_output.put_line('Produkt: ' || to_char(MyRes)); 
        
    END;
    /
    Published by: netaktiv on 21.02.2012 13:24

    Published by: netaktiv on 21.02.2012 13:25

    (1) If you declare procedures in an anonymous PL/SQL block (which itself is not a particularly good way to organize the code), the procedure for declarations must come after all the variables are declared.
    (2) you do not use the keyword VARIABLE when you declare variables in PL/SQL
    (3) you have a fence extra paren in the SELECT statement in the OutputDouble that needs to be removed
    (4) the appeal dbms_output.put_line in OutputDouble should, without doubt, refer to the variable local MyTextResult, not same that does not exist.
    (5) the RETURN clause in the declaration of a function must be unique and must come before the IS
    (6) add a little more indented is useful for the following code.

    Put it all together, something like this works

    SQL> ed
    Wrote file afiedt.buf
    
      1  DECLARE
      2     -- Definitions
      3     MyRes  Number;
      4     MyVal3 Number := 3;
      5     MyTxt3 VARCHAR(30) := 'Text mit 3';
      6      -- Output Comment and 2*Input
      7      PROCEDURE OutputDouble(SingleValue IN Number, MyComment IN VARCHAR)
      8      IS
      9          MyTextResult VARCHAR(100);
     10      BEGIN
     11          SELECT MyComment || ' ' || to_char(2 * SingleValue)
     12            into MyTextResult
     13            from dual;
     14          dbms_output.put_line(MyTextResult);
     15      END;
     16      -- Return Product of Val1 and Val2
     17      FUNCTION MyProduct(Val1 IN NUMBER, Val2 IN NUMBER)
     18          return Number
     19      IS
     20          MyNumResult Number := 0;
     21      BEGIN
     22          MyNumResult := Val1 *Val2;
     23          return MyNumResult;
     24      END;
     25  BEGIN
     26      -- Main process block
     27      OutputDouble(MyVal3, MyTxt3);
     28      MyRes := MyProduct(MyVal3, 5);
     29      dbms_output.put_line('Produkt: ' || to_char(MyRes));
     30* END;
    SQL> /
    Text mit 3 6
    Produkt: 15
    

    As I said above, however, this isn't a particularly good way to code generation. You are much better (a lot!) create a procedure as OutputDouble first just debugging that, then create a function like MyProduct, debugging that and then just try to put it all together. Creating a single block that declares its own procedures and functions only makes it harder to debug and harder to generate the code of the work by the Assembly and testing of small building blocks.

    Justin

  • Apply the variable definition in the subclass with abstract method

    Hello

    It's his practice use? :
    public abstract class Base {
        private int importantPrivateVariable = setImportantPrivateVariable();
        protected abstract int setImportantPrivateVariable();
    }
    I want to apply the extension of the class to define a private variable, but there is no variable abstract in java, I can use a method for that.

    Thank you
    lemonboston

    Edit: the variable can be protected as well, I guess that's not important here, but correct me if I'm wrong

    lemonboston wrote:
    Hello

    It's his practice use? :

    I don't think it's so common, but it's easily understandable code. However, there are several problems with this approach:

    public abstract class Base {
    private int importantPrivateVariable = setImportantPrivateVariable();
    protected abstract int setImportantPrivateVariable();
    }
    

    I want to apply the extension of the class to define a private variable

    This is some what your code implements: your base class requires the subclasses to return an int value, and the Base class uses this value to assign to the variable.

    Therefore, the method should be called to (for example getInitialValueOfImportantVariable()+ to have a consistent naming with his signature (it returns a value, whereas a regular setter must declare a void return type: protected abstract void setImportantPrivateVariable (int someValue);).)

    Edit: the variable can be protected as well, I guess that's not important here.

    Well, Yes, it is 'important' - at least, there is a noticeable difference: the variable is private, the base class is free to treat it as seems it (for example, assign the value at construction time and never change it later). If the variable was protected, the subclass could change in ways and at times not known by the base class.

    but correct me if I'm wrong

    There is a trap in this construction: the method is called in the variable initializer, i.e., behind the scenes, about during execution of the Base, so before the constructor of the sub-class class constructor. For example, you call a method on an object that is not completely initialized (for example some of its attributes may always be null at this point). There is a rule that discourages this kind of situation, which goes something like "no calling private and unofficial constructor methods.

    To avoid this trap, two options:
    -requires an int argument in the constructor of the Base class, as suggested above
    -Don't be and set the value of the important variable in the code of the initializer or the constructor, but a special method in the base class instead:

    public abstract class Base {
        private int importantPrivateVariable; // default value is zero
    // or alternatively:
    //    private int importantPrivateVariable = ...; // Some default value
        protected abstract int getImportantPrivateVariable();
    
        public void initializeImportantPrivateVariable() {
            importantPrivateVariable = getImportantPrivateVariable();
        }
    }
    

    This construction is a degenerate form of a common model known as the model method (where a base class method calls usually several methods of the subclass in a specified order and with a specified sequence, allowing for the subclass to implement the details of the methods).

    The downside is that the client code (the one that uses the Base instance) must know when to call this initialization method, while initialization, a constructor-based allows the free client code of don't like do not at all.

    Much luck,

    J.

  • Reset of the variable defined by guest presentation

    I have 2 guests, State and City, led by a single button print. The State guest sets a variable of presentation called STATE_VAR and filters prompt City column values from list of choices based on the STATE_VAR and sets its own presentation CITY_VAR variable when the user selects a choice in the list. The two guests have flaws - STATE_VAR fast by default to a specific State in the initial page loads and the CITY_VAR defaults to nothing (no option in quick dialogue).

    This question I want to address is reset the variable of CITY_VAR presentation (in the default value, no option in the quick dialog) when the user selects a different State in the guest of the State . The sequence I want to reach is listed below.

    (1) on page load STATE_VAR and State quick choice are defined in Michigan and the CITY_VAR and the town guest are set to nothing (White option)
    (2) user selects Detroit as one of the cities in the prompt the City and click on the GO button.
    (3) the loading of the page, the presentation of STATE_VAR variable and corresponding State guest are set in Michigan, but now the guest of CITY_VAR and the City are now set in Detroit
    (4) the user selects a different option in the State prompt, say Nebraskaand click on the GO button
    (5) after loading the page, the presentation of STATE_VAR variable and corresponding State guest are now defined in Nebraska, however, the default option selected in the rapid City and corresponding CITY_VAR variable of presentation are still Detroit , although the choice list now contains different values.

    Is there anyway to restore the prompt of the CITY_VAR and the default City Nothing (no) selected state, essentially reset the variable of presentation?

    Thank you.

    I fear... you will not be able to achieve...

    The best thing you can do is check the box store in the guest of the city...

    Thank you
    Ashish

  • Double click and get and store the value in the variable.

    Hello

    It is my intention when I double click on a particular record on a table, I want to enter or store the specific record value in a variable and call this variable in the print/preview PLSQL code button.

    Below, I show the screenshot that contains a preview in the form of table and print button. After filling in the data. user double click the code officer LC354 and click Print Preview/mode button, it should display the report for only the
    Code of the agent of LC354(it's what I want). But normally when I click Preview before printing it affects wil see the report of the code of the agent of LC354 and LC325(which I don't).

    http://ImageShack.us/photo/my-images/811/printpb.PNG/

    My problem is how to capture the value ((*LC354*)) particular registration after double click the code(*LC354*) agent?

    I tried to store the agent code in the variable AG_CNT in mouse double click trigger with after the plsql code. but it dosent work.
    declare
    AG_CNT varchar2(10);
    begin
    *AG_CNT* :=GET_ITEM_PROPERTY('RFQ_AGENT_DETAILS.AGENT_CODE',CURRENT_RECORD);
    end;
    After that pass this AG_CNT value in *: AG_CODE *. the code below is in the Print/Preview button.
         cursor c1 is select nvl(count(ENQUIRY_NO),0) from scott.EXP_QUOTE_STATUS 
         where ltrim(rtrim(upper(job_status))) like 'APPROVED%' and ENQUIRY_NO = :REQ_FOR_QUOT.ENQUIRY_NO
    AND AGENT_CODE=*:AG_CODE* ;
    How to do this?

    SKUD.

    Hello

    When you click a folder, the focus moves to that record. To get the values of each element, just use the standard:

    :value := block.item ;
    

    François

  • Communication with the main movie off external class

    Hello

    Hello, after recognizing that all my problems are as a result of the problem, I just start with AS3, having a litte experience with AS2 and common OOP. So, I try to understand the concept of AS3 on this level.

    My problems are mainly in the defined direction how outwardly objects communicate with the main movie.

    For example:

    (1) can I call a DisplayObject instance out of an external class, if this DisplayObject is defined and added to the display list in the MainMovie?

    2) can MovieClipObjects instance within a table, which works like an instance variable? I think that will cause trouble in the cascade of display list:

    {should be corner braces: class.} MovieClips {i} = new MovieClip();    -> root.class.MovieClips {1} Point separates it levels in the display list, but also object and attribute.

    Thank you

    the debugger does not recognize this error message?

    and if you want to clear the memory occupied by mc when you use:

    var a: Array = [];

    var mc:MovieClip = new MovieClip();

    a [0] = mc;

    use:

    If it was added, remove the mc of the displaylist.  remove all listeners and other references if there is.

    a [0] = null;  or a.shift (), if you do not have null in an array element.  Use a.splice (i, 1), if you used a [i] = mc;

    MC = null;

Maybe you are looking for