Error selecting title in Array

Hello Kirupa users

I am working on a PathFinder
It is working pretty well but i have a problem detecting walls

In my Array i only user 0 and 1
The 0 is a walkable and 1 is a wall

I user this calculation to determen which title in the array i need to check for walls
ActionScript Code:
[LEFT][COLOR=#000000]var[/COLOR] tt1:[COLOR=#0000FF]Number[/COLOR] = [COLOR=#000000]([/COLOR]t1.[COLOR=#000080]y[/COLOR] * [COLOR=#000080]5[/COLOR][COLOR=#000000])[/COLOR] + t1.[COLOR=#000080]x[/COLOR]
[/LEFT]

But it is not working
It is detecting walls at places where are no walls

And to check if the title is a wall or a walkable title is use:
ActionScript Code:
[LEFT][COLOR=#0000FF]if[/COLOR][COLOR=#000000]([/COLOR]map[COLOR=#000000][[/COLOR]tt1[COLOR=#000000]][/COLOR] == [COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR]
[COLOR=#000000]{[/COLOR]
t1.[COLOR=#000080]ready[/COLOR] = [COLOR=#000000]false[/COLOR]
[COLOR=#000000]}[/COLOR]
[/LEFT]

This is my map Array:
ActionScript Code:
[LEFT][COLOR=#000000]var[/COLOR] map:[COLOR=#0000FF]Array[/COLOR] = [COLOR=#000000]new[/COLOR] [COLOR=#0000FF]Array[/COLOR]COLOR=#000000[/COLOR]
map = [COLOR=#000000][[/COLOR][COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],
[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]1[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],
[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]1[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],
[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]1[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],
[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR],[COLOR=#000080]0[/COLOR][COLOR=#000000]][/COLOR];
[/LEFT]

The t1.x and t1.y are the same as
ActionScript Code:
[LEFT][COLOR=#000000]var[/COLOR] cx:[COLOR=#0000FF]Number[/COLOR] = [COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]round[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]var[/COLOR] cy:[COLOR=#0000FF]Number[/COLOR] = [COLOR=#0000FF]Math[/COLOR].[COLOR=#0000FF]round[/COLOR]COLOR=#000000[/COLOR];
[/LEFT]

But beacause you have miltile ways to walk(north east south and west)
You must increase or decrease the value by 1 to get the right title spot
I won’t include the code for that beacuse that is prety straight forward.

What am i doing wrong?