# Problem with RPG:Tile tutorial

**URL:** <https://forum.kirupa.com/t/problem-with-rpg-tile-tutorial/274525>\
**Category:** flash\
**Created:** [October 30, 2008, 10:41pm UTC](https://forum.kirupa.com/t/problem-with-rpg-tile-tutorial/274525 "2008-10-30T22:41:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dachimpy](https://avatars.discourse-cdn.com/v4/letter/d/a4c791/32.png) [@dachimpy](https://forum.kirupa.com/u/dachimpy)\
**Post date:** [October 30, 2008, 10:41pm UTC](https://forum.kirupa.com/t/problem-with-rpg-tile-tutorial/274525/1 "2008-10-30T22:41:27Z")

</div>

I have been following [kirupa.com - RPG Programming: Tiles](http://www.kirupa.com/developer/actionscript/rpgprogramming6.htm) tutorial but have been applying it to my program rather than copying it.

I have hit a problem with the collision detection

> [SIZE=2][COLOR=black][FONT=Arial][SIZE=2]guyTL = _root["tile_"+Math.floor((x-(\_parent.\_width/2)+1)/_root.tileWdth)+"_“+Math.floor((y-(\_parent.\_height/2)+1)/\_root.tileHght)].barrier; guyTR = _root["tile_”+Math.floor((x+(\_parent.\_width/2)-1)/_root.tileWdth)+"_“+Math.floor((y-(\_parent.\_height/2)+1)/\_root.tileHght)].barrier; guyBR = _root["tile_”+Math.floor((x+(\_parent.\_width/2)-1)/_root.tileWdth)+"_“+Math.floor((y+(\_parent.\_height/2)-1)/\_root.tileHght)].barrier; guyBL = _root["tile_”+Math.floor((x-(\_parent.\_width/2)+1)/_root.tileWdth)+"_"+Math.floor((y+(\_parent.\_height/2)-1)/\_root.tileHght)].barrier;  
> [/SIZE][/FONT][/COLOR][/SIZE]  
> The result of these always return as undefined, the reason is that I have placed my code in a different place than the tutorial advises - frame one rather than the movie clip so I think the problem lays in the relative adressing such as \_parent.

I need help trying to figure out what to edit in order for this code to return the correct true/false values for the collision detection.

my guy is attached in \_root.itemsMC and called Ship\_MC  
the tiles are attached in \_root.tiler
