Cannot access array from a function

Hi, i’m making a tile based game. There is an array which holds the Map

var myMap:Array = [[…],[…] <-- the 2d array with numbers representing tiles

at a later function which is called by going through 2 other functions
like begin() calls move() , and move() calls collision()

whenever i try to access the array from collision() in the form
myMap[var1][var2] it throws this error:

TypeError: Error #1010: A term is undefined and has no properties.

However myMap[0][1] works.
i’ve used trace to find this is the problem. And all identifiers are correct.