Jump to content


Generating two movie clips with onRollOver problem


  • You cannot reply to this topic
No replies to this topic

#1 simonk

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 01 January 2006 - 05:54 AM

Hi,
I have an XML file with all the shops information and Im to generate a shopping centre like floor plan according to this XML. I have the following code:

function floorplan() {
max = myshop.childNodes[0].childNodes.length;
spacing = 20;
for (var r=0; r<max; r++) {
name = "shop" + r;
_root.list.attachMovie("shop", name, r);
_root.list[name]._x = r*20;
_root.list[name]._y = 0;
_root.list[name].name_text.text = r;
_root.list[name].name_text.textColor = 0xFFFFFF;

name1 = "frame" + r;
_root.list.attachMovie("frame", name1, r+1*100);
_root.list[name1]._x = r*20;
_root.list[name1]._y = -50;
_root.list[name1].store_name.text = shopname;
_root.list[name1]._alpha = 0;

_root.list[name].onRollOver = function () {
temp = _root.list[name].name_text.text;
trace (temp);
temp2 = "frame" + temp;
_root.list[temp2]._alpha = 100;}
trace (shopname);

}
}
}
myshop = new XML ();
myshop.ignoreWhite = true;
myshop.load ("shops.xml");
myshop.onLoad = function (success) {
floorplan();
}


Within the function, the list.[name] is the actual shop, and the list.[name1] is a dialogue where it will appear when my mouse is over the shop, but I cant make the two relate to each other. No matter which shop I move my mouse over, the dialogue is always the last shop.
Please help, Im confused. :)
Thanks a lot.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users