Check the box 2 tables for difference

Hello

I need help, I am trying to loop through the two tables that contain clips video and compareing the differences

Here is my code so far:

var SavedJobArray:Array = new Array();

var NewJobArray:Array = new Array();

function FillSavedArray (): void

{

var Temp: MovieClip = new BlackMC();

Temp.JobNumber = 11;

SavedJobArray.push (Temp);

var Temp2:MovieClip = new BlackMC();

Temp2.JobNumber = 22;

SavedJobArray.push (Temp2);

var Temp3:MovieClip = new BlackMC();

Temp3.JobNumber = 33;

SavedJobArray.push (Temp3);

}

function FillNewArray (): void

{

var Temp: MovieClip = new BlackMC();

Temp.JobNumber = 111;

NewJobArray.push (Temp);

var Temp2:MovieClip = new BlackMC();

Temp2.JobNumber = 22;

NewJobArray.push (Temp2);

var Temp3:MovieClip = new BlackMC();

Temp3.JobNumber = 33;

NewJobArray.push (Temp3);

var Temp4:MovieClip = new BlackMC();

Temp4.JobNumber = 444;

NewJobArray.push (Temp4);

}

var SameJobCount:int = 0;

function checkJobArray (): void

{

trace ("saved job Array:" + SavedJobArray.length);

trace ("new Job Array:" + NewJobArray.length);

var TempSaved:MovieClip;

for (var i: int = SavedJobArray.length - 1; i > = 0; i--)

{

TempSaved = SavedJobArray [i];

var TempNew:MovieClip;

for (var j: int = NewJobArray.length - 1; j > = 0; j-)

{

TempNew = NewJobArray [j];

If (TempSaved.JobNumber is TempNew.JobNumber)

{

SameJobCount ++;

trace ("match:" + TempSaved.JobNumber + "&" + TempNew.JobNumber);

If the match is found, remove them from these two tables

SavedJobArray.splice (SavedJobArray [i], 1);

NewJobArray.splice (NewJobArray [j], 1);

}

}

}

traceNewJobs();

}

function traceNewJobs (): void

{

var TempNew:MovieClip;

for (var j: int = NewJobArray.length - 1; j > = 0; j-)

{

TempNew = NewJobArray [j];

trace ("NEW JOB:" + TempNew.JobNumber);

}

}

FillSavedArray();

FillNewArray();

checkJobArray();

I want to be able to do, is makes a loop on both tables and see if the "number of jobs does not equal"... compare the savedjobarray with the newjobarray and see if the new work contains a number of jobs that the registered job board does not.

I tried something different and those that correspond to I spread the tables... but it's not really working.

I hope that this fact,

Thank you in advance for your help!

OK, so all that matters is the number of jobs and the elements may appear anywhere in any list. You want just the unique number of jobs in any list. For this I would be to iterate through the tables of the number of jobs in the two temp tables. After I would go longer temporary table, eliminating any number of jobs (from two temp tables) that match. What you end up with is potentially two paintings not corresponding employment that you can combine into a single list.

Sounds more complicated than it is.

function checkJobArray (): Array

{

expansion (outer loop)

var tempArr1:Array;

var arrayOrder:int = 1; 1 = saved is temp1, 2 = New temp1

If (SavedJobArray.length > NewJobArray.length)

{

tempArr1 = SavedJobArray

}

on the other

{

tempArr1 = NewJobArray;

Since the New is tempArr1, adjust arrayOrder

which is later used to return results

arrayOrder = 2;

}

smallest (inner loop)

var tempArr2:Array = SavedJobArray.length< newjobarray.length="">

iterate over a greater Bay

for (var i: int = 0; i< temparr1.length;="">

{

check if the job matches the smallest matrix (iteration)

for (var j: int = 0; j< temparr2.length;="">

{

football game?

If (tempArr1 [i]. JobNumber is tempArr2 [j]. JobNumber)

{

Yes, remove both

tempArr1.splice (i, 1);

tempArr2.splice (d, 1);

We have reduced the table on this index,

must reduce the index continue

i-- ;

j-- ;

increase matching jobs

SameJobCount ++;

}

}

}

all that's left are jobs that do not match.

you want a single list? Concat together:

return tempArr2.length > 0? tempArr1.concat (tempArr2): tempArr1;

you want to separate lists? return of the separate tables [SavedJobs, NewJobs]

the use of arrayOrder from above to determine the appropriate order.

return arrayOrder == 1? [tempArr1, tempArr2]: [tempArr2, tempArr1];

}

Test:

differences in var: Array = checkJobArray();

trace (differences.length + 'difference (s)');

for (var idx:int = 0; idx< differences.length;="">

{

trace (differences [idx]. JobNumber); See the differences

}

Traces:

3 difference (s)

111

444

11

As with anything, it has a limit. If you have any repeated JobNumbers 1 single corresponding instance of them is removed, leaving behind the JobNumber double as a difference.

example of a nickname for example (which means that it is not the code you can use, just understand)

var NewNumbers:Array = [1, 1, 2, 3];

var SavedNumbers:Array = [1, 2, 3, 4];

If these tables could run through this function, only the first duplicated "1" would be removed from the two bays, leaving another '1' NewNumbers. In the end, the difference would be: 1, 4

You may want to only * shrug *.

Tags: Adobe Animate

Similar Questions

  • Firefox does not allow me to check the box "Remember passwords for sites". What should I do?

    I have iAntivirus, not Norton or McAfee. Wanted to install "remember passwords" and "remember pass" are not add-ons, but the key to the right arrows and after removing these 2 modules I can't check the box "remember password for sites". What should I do? I really want to save my passwords.

    Hello romkom, you can not save passwords when you chose to always run firefox in private browsing mode in the Preferences > privacy Panel...

  • No speaker in the taskbar icon. Impossible to check the box greyed out for its control panel of configuration/sounds

    Reference to any icon on the desktop... fix .suggested.

    I did a right click Start, open and look through everything. There is NOT a speaker ICON is located. What should I do next?

    I don't have windows vista... I have XP-Prof.

    You are in the wrong forum. It is the Vista forum.

    Please repost in the XP forum, office and appearance.
    http://social.answers.Microsoft.com/forums/en-us/xpdesktop/threads

    The next time of property to specify your OS, operating system, until you state your problem. For the benefits of others looking for answers, please mark as answer suggestion if it solves your problem.

  • In the Internet properties and connections and the local network settings, I uncheck the box for a proxy server, but in a few moments, the computer checks the box

    In the Internet properties and connections and the local network settings, I uncheck the box for a proxy server (because it is blocking my access to Internet Explorer), but within moments, the computer checks the box. What can I do to stop the area of the check proxy server box?

    original title: LAN settings

    Have you checked for viruses?

    http://www.eset.com/us/online-scanner/

    It is very common that the virus to do.

  • Apply for a job that an i marked the days I can work a TI says that I have not checked the boxes

    I am to apply for a job a TI says check the box to indacate what days I am free to work, so I check, a TI goes back to the page saying I did not mark the box, I'am so ask what she could be, how can I fix it, if it can be fixed!

    Thank you

    Bettyjo Applehans

    Hi Bettyjo Applehans,

    1. what happens on the only site?

    If so, you will need to contact site support.

    Step 1:

    You can temporarily disable a security software and firewall installed on the system and check if the problem persists.

    Note: Be sure to enable the security software on the computer after checking.

    Step 2:

    If you use Internet Explorer, then you can try to disable temporarily add ons and check if it helps:

    Steps to open Internet with no mode of modules:

    a. click on start

    (b) in the search box, type in Internet explore

    c. Select Internet (no add-on mode)

    For further ifnroation, please see the following article

    How the modules of the browser affect my computer?

    Hope this information is useful.

  • PDFMaker, Options, create PDF/A-1 a in Word. Where can I change the setting so I did not check the box for each file, I create?

    PDFMaker, Options, create PDF/A-1 a in Word. Where can I change the setting so I did not check the box for each file, I create?

    Win OS: Windows 7

    Acrobat 9 Pro

    Hello

    You can do this to change the registry settings.

    Go to run type Regedit to open it.

    First make a backup of the registry.

    Here is how do.

    Go to HKEY_CURRENT_USER > software > Adobe > Acrobat > PDFMaker 9.0 > > Word > settings

    You need to change the DWORD values & chain listed below.

    Chain: JobOptions

    Value: PDFA1b 2005 RGB

    DWORD: PDFComplianceIndex

    Value: 1

    DWORD: PDFComplianceLevel

    Value: 1

    Close the registry editor

    Thank you

    Abhishek

  • I connect to outlook and put my email address and full security in when I disconnect and reconnect I must sign in everyntime even after checking the box to keep me connected?

    e-mail Outlook for windows 7does won't keep me signed in, I save my e-mail and security question to keep me signed in but after that I have close and open later he always wants me to re sign in? ... Joseph thanks, even after signing, constantly checking the box to keep me in...

    Hi Joseph,

    1. what browser do you use on your computer?

    2. is the specific question to Outlook.com or all web mail?

    I suggest you follow the steps described in the link if you are using Internet Explorer and let us know the State of the question below.

    Automatically fill in website forms and passwords:

    http://Windows.Microsoft.com/en-in/Windows7/fill-in-website-forms-and-passwords-automatically

    I hope this helps.

  • Despite checking the box "don't import suspected duplicates", my Lr4 still re - import hundreds of photos. Anyone know how to avoid this?

    Despite checking the box "don't import suspected duplicates", Lr4 still re - import hundreds of photos of the same exact card, they were imported original. Anyone know what I should do differently next time?

    The problem of duplicate detection is that, as far as I know, Lightroom uses details that it detects on the imported file (looking at the EXIF data and drop stats) and what is already in the catalog. Unless it finds an exact match for all parameters, the file is not a duplicate. From my own experience, if Lightroom decides that a file is a duplicate is almost always correct. However, when missing, it really lacks. I have not read anywhere that Lightroom is built and store a hash number, which would make the process more accurate. I also suspect that the search for duplicates is when you import a series of photos of a place (a card for example) and they are stored in the same folder, all the time. So, if you take a memory card and import all photos to Folder_X and try again later, and reimport the same photos in Folder_X, Lightroom will catch that they are duplicates. But if you import Folder_Y of this same group of photos, Lightroom intercepts not it indicating that the comparison is not large catalog. I'm not sure of how to influence this behavior and it is not anything that you hurt or did not. It's just like that...

  • Thunderbird is not save my password even if I continue to check the Save password box. Fails to retrieve mail when I check the box.

    Recently, I've migrated my profile of Thunderbird to a new computer. Everything works great, except that Thunderbird doesn't remember my password for the account. I am the only user on the machine, and I check only one account, so I don't want to set up a master password... I want just the program to remember my password for the e-mail account. I get the question 'Do you want to save your password?', every time I run the program... but if I check the box to do this, mail is not retrieved. (No error message, just nothing happens.) If I get the password without the box, the mail is retrieved. Even with the sending - I wonder for the time of password the first by session I have send a message. If I check the box 'Save password' send fails. If I do not check the box, sending passes.

    This has been a consistent behavior for about a month now. I'm not just randomly in the password incorrectly. It happens that way every time.

    That is what it is? Y at - it a fix for this? I want to just Thunderbird to remember my password.

    Try this:

    Make folders and hidden files visible

    In thunderbird

    • Help > troubleshooting information
    • Click on the view file"" button.

    a new window opens showing profile_name folder.

    • Close Thunderbird now - this is important
    • Scroll down - find and delete this file: key3db
    • Close this window - upper-right X

    Restart Thunderbird.

    At the password prompt, enter the password and select the "Manager password use to remember the password" check box and click OK.

    Note: If you use a product like CCleaner, then it's probably compensation info session and password. In this case, you will need to make an exception for files of thunderbird in CCleaner to stop cleaning Thunderbird.

    Please report on the results.

  • Why Firefox «ask» when I checked the box 'don't ask me '?

    When you try to open media as something of an email, Firefox always shows me the window asking me to check which software program to use when opening the file, even though I checked what, to use and the box 'don't ask me. " I also checked the box 'always use this program ". It is very annoying.

    is always

    This occurs because the file that you download is an accessory, so Firefox will always ask you what you want to do with the file.

    This is a security feature, since attachments can often contain harmful files. So there's no way to automatically open an attachment without asking you first. This box can be confusing when it appears in a download of attachments, given that the setting does not apply to the attachments.

  • When I check the box to me connected, when I sign keep, it does not keep me logged on Windows Live.

    Original title: keep me connected

    When I check the box to keep me connected, when I sign, it dose not keep me connected. What can I do?

    Hello

    You can ask your questions on the links of the following forums.

    http://answers.Microsoft.com/en-us/windowslive/Forum/LIVEmail

  • Hello everyone my CD Rom has stopped playing DVDs but plays the audio CD and CD-ROM. I tried to uninstall it without result. The box pop up for media player does not appear when I insert any kind of CD.

    Hello everyone my CD Rom has stopped playing DVDs but plays the audio CD and CD-ROM. I tried to uninstall it without result. The box pop up for media player does not appear when I insert any kind of CD.

    Hello
    Try this:
    http://support.Microsoft.com/kb/306318
    b Eddie

  • Why not an edited image is not at the Organizer even if I check the boxes that indicate that it should?

    I imported a photo in the Organizer.  Now I edit this photo and I check the boxes indicating the program to put the image in the organizer and also the image with the original pile.  Can I save the image.  When I return to the Organizer, 9 times out of 10, the image won't be there, which seems strange, is that once in a while where I worked on the image will appear in the Organizer as it is supposed to, but is most of the time it won't.  This requires me to manually import the image published in the organizer and then manually put the image with the original sound.  It's frustrating because it takes the time it should not.  Can anyone help?

    What is your version of elements?

    What you describe looks like a bug in PSE12. This has been fixed by an update: use the menu help/update.

  • How can I check the status of activation for CS4

    I would like to check the status of activation for CS4, S/N < mod redacted >

    Click Help and, if enable is dimmed and disable is clickable, your program is currently active.  If disable is dimmed and to activate is clickable, your program is currently disabled.

  • Change the label after you check the sum of calculation for the column

    Hi all

    I have a crosstab report and I checked the 'sum of calculation' for each column and the total at the bottom. The label is 'full report '. How to change this label?

    Thanks in advance!

    On the attributes page of the report, in the region to break the formatting, you can put your text into the field "Display this text when printing of money to report".

Maybe you are looking for