TypeError: Error #1010: a term is undefined -> Error is thrown only if application is online
Hi everybody,
I have strange error which i tried to fix all day but with no result. The application is working fine in debug modus, but after I uploaded it to my server it throws following Error:
TypeError: Error #1010: Ein Begriff ist nicht definiert und hat keine Eigenschaften. (A term is undefined and has no properties.)
at controller.objects::LevelMap/getCurrentXPosition()
at screens::MainMenu/showMap()
at screens::MainMenu/__PlayzoneScreen_showMapEvent()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at screens::Playzone/showMap()
at screens::Playzone/__mapButton_mouseOver()
This error is thrown ( I guess ) at this point:
Object
public class LevelMap
{
//holds the current level positions (ID) for the map in an two-dimensional array (X / Y coordinates)
//Index = SceneID-1 -> [ '[X SceneID=1][Y SceneID=1]', '[X SceneID=2][Y SceneID=2]' ... ]
private var _mapXYArray:Array;
public function LevelMap(mapXML:XMLList):void
{
this._mapXYArray = new Array();
for(var i:int = 1; i <= mapXML.position.length(); i++){
var x:int = mapXML.position.(@id==i).x;
var y:int = mapXML.position.(@id==i).y;
this._mapXYArray.push(new Array(x,y));
}
}
public function getCurrentXPosition(currentSceneID:int):int{
currentSceneID--;
return _mapXYArray[currentSceneID][0]; //Point of Error?!
}
(...)
}
This Object-Method is used in the Main class with following code:
private var levelMap:LevelMap;
private function showMap(event:ShowMapEvent):void{
if(MapScreen.visible){
(...)
}
else{
MapScreen.visible = true;
var x:int = levelMap.getCurrentXPosition(game.nextSceneID); //call of getCurrentXPosition()
var y:int = levelMap.getCurrentYPosition(game.nextSceneID);
MapScreen.setCurrentPosition(x,y);
}
}
XML File
(...)
<levelmap source="pictures/TRE01Map.jpg">
<position id="1"><x>70</x><y>31</y></position>
<position id="2"><x>55</x><y>12</y></position>
(...)
This methods are used to show on a map where the player is at the moment. It is using X/Y coordinates, which are parsed from a XML file. This works fine! The showMap()-function calls the object to get the coordinates with the get CurrentXPosition with an ID from the current scene.
I really don't understand, why this works fine in Adobe Flash Builder, but not after I export it to a release build. XML-Files seems to be right.
If anybody has any ideas, why this could happen, please feel free to answer!
Thanks,
Kris
