Skip to main content
Inspiring
July 26, 2013
Question

coordinates for a point vector inside an object vector.

  • July 26, 2013
  • 1 reply
  • 762 views

private var tileVector:Vector.<Object>;

private var visitedVector:Vector.<Point>;

Hi - I'm trying to make my cloudExplosion mc appear at the same position as a tile/actor mc clicked. That actor mc is inside a point vector and those point vectors are inside an Object vector.

cloudExplosion.x = tileVector[visitedVector.x][visitedVector.y]

I trace this out and I get [object Object] - I am trying to get the coordinates not the object itself.

I tried tracing the vector point and I got the coordinates BUT an error too - couldn't find the property  (x=5, y=2),(x=4, y=3),(x=5, y=4)    in vec.Vector.<Object>

trace(tileVector[visitedVector]);

Well, I want those vector coordinates so my animation mc can appear in all the places where the tiles/actors are clicked.

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 26, 2013

tileVecor is an object.  what's that object look like?

if that object is a vector of points, you would use something like:

tileVector.x

Inspiring
July 26, 2013

I did these trace statements if that helps at all.

trace(tileVector[visitedVector]);//traces error but gives coordinates(x=2, y=4),(x=1, y=4),(x=1, y=3)

trace(tileVector[visitedVector]);//traces error but gives coordinates(x=1, y=0)

trace(tileVector[visitedVector.x][visitedVector.y])//[object Object]

trace(tileVector[1][1].x);//undefined

kglad
Community Expert
Community Expert
July 26, 2013

again, tileVecor is an object.  what's that object look like?