# \[AS3\] Need help with verify error

**URL:** https://forum.kirupa.com/t/as3-need-help-with-verify-error/215151
**Category:** flash
**Created:** [February 4, 2007, 11:24pm UTC](https://forum.kirupa.com/t/as3-need-help-with-verify-error/215151 "2007-02-04T23:24:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![omegaxmk2](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/omegaxmk2/32/3262_2.png) [@omegaxmk2](https://forum.kirupa.com/u/omegaxmk2)
#### Post date: [February 4, 2007, 11:24pm UTC](https://forum.kirupa.com/t/as3-need-help-with-verify-error/215151/1 "2007-02-04T23:24:18Z")

</div>

Hello everyone. I was testing this little prototype method I made up (in a file, Array\_Update.as) (I do realize I could’ve used “for each…in” instead of “for…in”, but I just didn’t…),

```auto

Array.prototype.update = function(model:Array, prop1:String, prop2:String):void {
    var i:String;
    var j:String;
    sub: for (i in this) {
        for (j in model) {
            if (model[j][prop2] == this*[prop1]) {
                continue sub;
            }
        }
        this.splice(this.indexOf(this*), 1);
    }
    add: for (j in model) {
        for (i in this) {
            if (model[j][prop2] == this*[prop1]) {
                continue add;
            }
        }
        this.push(model[j]);
    }
}

```

in this class (in the same directory as Array\_Update.as):

```auto

package com.cation.apps.demos {
    import flash.display.Sprite;
    [SWF(backgroundColor="#000000",width="200",height="200")]
    public class Demo extends Sprite {
        public function Demo() {
            include "Array_Update.as";
            var firstArray:Array = [
                        {x: 0},
                        {x: 1},
                        {x: 2, y: 1},
                        {x: 3, z: 0}
                        ];
            var secondArray:Array = [
                        {x: -1},
                        {x: 1},
                        {x: 2, y: 2},
                        {x: 4}
                        ];
            firstArray.update(secondArray, "x", "x");
        }
    }
}

```

The result should be:

```auto

firstArray = [
                {x: -1},
                {x: 1},
                {x: 2, y: 1},
                {x: 4}
                ];

```

It makes perfect sense to me, and should work, but whenever I compile it, it gives me a runtime error:

```auto

VerifyError: Error #1068: int and * cannot be reconciled.
    at ()
    at com.cation.apps.demos::Demo$iinit()[..\com\cation\apps\demos\Demo.as:19]

```

(I replaced some of the directory with “…”).

Array.prototype.update basically takes an array as an argument, and two string representations of properties to be compared and “updates itself”

That means it will remove any elements with a property value the model array’s own elements don’t have, and add any elements with properties from the model that its own elements don’t have, without touching any elements with matching values.

Maybe it doesn’t have many applications but the real problem is it gives that runtime error above. I don’t understand what’s wrong.

This is the compiled SWF, [http://img252.imageshack.us/my.php?image=demooi7.swf](http://img252.imageshack.us/my.php?image=demooi7.swf)

Any help is appreciated.
