Flash help
- Started
- Last post
- 7 Responses
- snizl
So yes, I need help, yet again.
I am working on a dynamic flash map. I am parsing xml then dynamically attaching mc's based on values in the xml, such as x and y corrdinates as well as data to populate dynamic txt fields.
The map also has a zoom function that zooms in on one of the 4 quadrants.When I zoom in I need to move the houses to new x and y coordinates to compensate for the map enlarging. So my question is what is the best way to access the dynamic mc's after they are attached to the stage. I tried setting a variable but i need to access it from another mc. Any help is appreciated. You can see an example of what I am going after here: http://houston.roycebuilders.com…
And my current as here: http://pastebin.coconut.se/?id=4…
The line that says //ATTACH MASTER COMMUNITIES
is where I am attaching the mc's in question.
- blaw0
name the houses house1, house2, etc.
set a variable of the total number of houses placed.
then run a for loop cycling through anything named 'house' plus a number.
for (var i=1; i
- snizl0
I guess I was a little unclear. The problem I am having is not attaching the movies but being able to access them after they are attached, such as moving them to new x and y coordinates. but i need to be able to do it without setting the instance name specifically.
- fugged0
create an array and populate it with a reference to each movieclip that you attach.
- snizl0
So would I have the array equal to the line that attaches the mc's?
such as:newArray = new Array();
newArray[i] = _root.housesHolder.multiHolder.a... ["multicom"+j], _root.housesHolder.multiHolder.g... {_x:mX[j], _y:mY[j]});
- snizl0
anyone else??
- fugged0
more or less, yes.
you can just do : newArray.push() to add items to the array, rather than explicitly adding by index.
so
newArray = new Array();
newArray.push(root.housesHolder... ultiHolder.attachMovie.... etc.)
- snizl0
I'm still a little lost. Say in another clip I have
onPress = function() {
houses.slideTo(x,y);
}houses being the clips i need to move