# HM - problem whit object properties

**URL:** <https://forum.kirupa.com/t/hm-problem-whit-object-properties/222929>\
**Category:** programming\
**Created:** [April 18, 2007, 2:56am UTC](https://forum.kirupa.com/t/hm-problem-whit-object-properties/222929 "2007-04-18T02:56:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![YakovZanardi](https://avatars.discourse-cdn.com/v4/letter/y/a4c791/32.png) [@YakovZanardi](https://forum.kirupa.com/u/YakovZanardi)\
**Post date:** [April 18, 2007, 2:56am UTC](https://forum.kirupa.com/t/hm-problem-whit-object-properties/222929/1 "2007-04-18T02:56:06Z")

</div>

Hello Kirupa community

Im having a big problem in my game. Im thinkin on it almost a entire month, just to figures whats happening. I isolated the code on another fla, to try to get it, but I have no clues.

The olny thing I know is this: I try to set only some tiles to be doors, but a lot of other tiles are set as door objects too.

This problem is not easy to explain. Heres the isolated code:

//first, I will create pseudo-tile objects, because in the original game, tiles are set by a xml.

var aaaTiles:Array = [];  
var tilez:Object = new Object();  
var tilez2:Object = new Object();  
var tilez3:Object = new Object();  
var tilez4:Object = new Object();  
var tilez5:Object = new Object();  
tilez.door = false;  
tilez2.door = false;  
tilez3.door = false;  
tilez4.door = false;  
tilez5.door = false;  
aaaTiles.push(tilez);  
aaaTiles.push(tilez2);  
aaaTiles.push(tilez3);  
aaaTiles.push(tilez4);  
aaaTiles.push(tilez5);  
//  
//all the tile objects have door property set to false  
//  
function build\_XmlMap(mapNamezz):Void {  
//  
//here I will build the world by a array from xml\>\>\>  
//  
System.useCodepage = true;  
var xmlMap:XML = new XML();  
var fMap:Array = [];  
xmlMap.ignoreWhite = true;  
xmlMap.load(mapNamezz);  
xmlMap.onLoad = function() {  
mainDados = this.firstChild.childNodes;  
len = mainDados.length;  
//cutting the string to fit a 2d map…

var hSplit:Array = mainDados[0].attributes.map.split(“ªª”);  
for (i=0; i\<=(hSplit.length-1); i++) {  
fMap\* = hSplit\*.split(",");  
}  
//add tiles  
for (i=0; i\<=(fMap.length-1); i++) {  
for (l=0; l\<=(fMap[0].length-1); l++) {  
//  
//now the interesting part: if the tile has door property, assign to it door true  
//  
zMap = fMap\*[l].split(“ºº”);  
fMap\*[l] = aaaTiles[zMap[0]];  
for (zz=0; zz\<zMap.length; zz++) {  
if (zMap\*.substr(0, 2) == “do”) {  
fMap\*[l].door = true;  
trace(“new door added”)  
}  
}  
}  
}  
//buildMap(fMap);  
//now I will check to see how doors was assigned  
for (v=0; v\<=fMap.length; v++) {  
for (b=0; b\<=fMap[0].length; b++) {  
if (fMap[v]\*\*.door) {  
trace(“yes we got a door\_\_\_:”+v+"\_"+b);  
}  
}  
}  
};  
}  
build\_XmlMap(“pak/map\_01.xml”);

////////////////////////////////////////////////////////////////////////////////////

What shows in trace screen:  
new door added  
new door added  
yes we got a door\_\_\_:1\_3  
yes we got a door\_\_\_:1\_4  
yes we got a door\_\_\_:1\_5  
yes we got a door\_\_\_:1\_6  
yes we got a door\_\_\_:1\_7  
yes we got a door\_\_\_:1\_8  
yes we got a door\_\_\_:1\_9  
yes we got a door\_\_\_:1\_10  
yes we got a door\_\_\_:1\_11  
yes we got a door\_\_\_:1\_12  
yes we got a door\_\_\_:1\_13  
yes we got a door\_\_\_:1\_14  
yes we got a door\_\_\_:1\_15

Two doors exist. A lot of more doors was created, why?

Thanks for reading, hard task.
