Hello once again.
Ok this is another thing that is driving me crazy.
I'll do my best (as always) to explain everything I do.
I have an scene (called mision1) that inside has 3 frames, room1, room2, and room3. Inside each room it has 2 static MCs. Besides this, I have a character that moves in .x
Ok now, what I want to do is that, in each room, when that character hitTestObject the objects AND the mouse is clicked over that object, action something.
So far, this is done correctly, like this:
if (roomPosition == "room1")
if (mouseObj.hitTestObject(mision1.object1_1_1) && (person.hitTestObject(mision1.object1_1_1)))
(The code for the object is: object[number]_[mision: in this case 1]_[room: in this case 1])
This is great, even though I tried the following but I had problems, using nameObject as event.target.name (that throws me the name of the object):
var nameObject = event.target.name
but when I tried to compare it with the mouseObj, says something about they are not the same class or something (sorry I'm tired right now, can't remember).
OK but thats another subject, the thing is that when I try this:
else if (roomPosition == "room2")
if (mouseObj.hitTestObject(mision1.object4_1_1) && (person.hitTestObject(mision1.object4_1_2)))
Tells me that the object is null; I think (I truly think) is because the room2 is in another frame of the mision1 MC.
So I though in 2 alternatives:
1) That I find a way to access all the objects no matter what frames they are.
2) Separate each room of the first mission in different MCs so I have mission1room1 MC, mission1room2 MC and so on; and of course, each of them will have only 1 frame.
Right now, the structure to the code is made to function having that 3 frames inside mission1. I think that, in that way, my code will be cleaner if I just can make "alternative 1)" to function (based too that I will have a total of around 60 rooms in the game)
What can I do?? If "alternative 2)" is the way, I will change everything and stick to it (haven't try it, but I think will correctly function)
Thanks so much guys for your time !!