Hello,
I am trying to pass information to a many dynamic text fields when rolling over various movieclips that are generated using a loop. I have tried everything I know but can not get pahting to work prpoerly. The rollover works in that the curser changes by does not execute the lines of code within the in line function. Any help is greatly appreciated (see red, bolded text (towards bottom) for problem). the Attached zipped swf is what it looks like as is.
Code:
//how many floors are there in the building?
var floors:Number = 25;
//on each floor starting with the 1st, how many tenants to a floor (0-6)? - all entries must have quotes around them
var tenantAmt:Array = [“1”, “1”, “1”, “6”, “6”, “6”, “5”, “5”, “5”, “5”, “5”, “5”, “4”, “4”, “4”, “4”, “4”, “3”, “3”, “3”, “3”, “2”, “2”, “2”, “1”, “1”, “1”, “1”, “1”, “1”, “1”, “2”, “2”, “1”, “1”, “1”, “1”, “1”, “1”, “1”];
// on each floor starting with the first, how many spaces are vacant (0-6)? - all entries must have quotes around them
var spaces:Array = [“1”, “0”, “1”, “3”, “2”, “1”, “5”, “4”, “3”, “2”, “1”, “0”, “4”, “3”, “2”, “1”, “0”, “3”, “2”, “1”, “0”, “2”, “1”, “0”, “1”, “0”, “0”, “0”, “0”, “0”, “0”, “1”, “0”, “1”, “0”, “0”, “0”, “0”, “0”, “0”];
//change initial x or y coordinate to compensate for more or less floors
var ypos:Number = 550;
var xpos:Number = 50;
// change divider to space floors closer(increase value) or farther apart (decrease value)
var divider:Number = 1.75;
// change the height or width of the floors to compensate for more or less floors
var Xscale:Number = 100;
var Yscale:Number = 100;
var txtypos:Number = ypos;
var txtxpos:Number = xpos - 40;
var sftxtxpos:Number = xpos + 200;
//enter in SF by floor number
var floorTXT:Array = [
[“201,265”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2”, “5”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”],
[“2,405”, “5,896”, “0”, “8,888”, “508”, “10,891”]];
trace(floorTXT[0][0]);
var sfTextArray:Array = new Array();
for (var i:Number = 0; i < floors; i++)
{
if (tenantAmt* == “1”)
{
this.attachMovie(“single”, “nFloor” + *, i, {_x:xpos, _y:ypos});
ypos -= this[“nFloor” + i]._height / divider;
this[“nFloor” + i]._yscale = Yscale;
this[“nFloor” + i]._xscale = Xscale;
this.attachMovie(“dtext”, “dtext” + *, i + 100, {_x:txtxpos, _y:this[“nFloor” + i]._y - 5});
this[“dtext” + i].textformatting.text = i + 1;
this.attachMovie(“sfText”, “sfText” + , i + 1000, {_x:sftxtxpos, _y:this[“nFloor” + i]._y+20 });
//trace([“dtext” +i]);
}
if (tenantAmt == “2”)
{
this.attachMovie(“double”, “nFloor” + *, i, {_x:xpos, _y:ypos});
ypos -= this[“nFloor” + i]._height / divider;
this[“nFloor” + i]._yscale = Yscale;
this[“nFloor” + i]._xscale = Xscale;
this.attachMovie(“dtext”, “dtext” + *, i + 100, {_x:txtxpos, _y:this[“nFloor” + i]._y - 5});
this[“dtext” + i].textformatting.text = i + 1;
this.attachMovie(“sfText”, “sfText” + , i + 1000, {_x:sftxtxpos, _y:this[“nFloor” + i]._y +20});
//trace([“dtext” +i]);
}
if (tenantAmt == “3”)
{
this.attachMovie(“tri”, “nFloor” + *, i, {_x:xpos, _y:ypos});
ypos -= this[“nFloor” + i]._height / divider;
this[“nFloor” + i]._yscale = Yscale;
this[“nFloor” + i]._xscale = Xscale;
this.attachMovie(“dtext”, “dtext” + *, i + 100, {_x:txtxpos, _y:this[“nFloor” + i]._y - 5});
this[“dtext” + i].textformatting.text = i + 1;
this.attachMovie(“sfText”, “sfText” + , i + 1000, {_x:sftxtxpos, _y:this[“nFloor” + i]._y+20});
//trace([“dtext” +i]);
}
if (tenantAmt == “4”)
{
this.attachMovie(“quad”, “nFloor” + *, i, {_x:xpos, _y:ypos});
ypos -= this[“nFloor” + i]._height / divider;
this[“nFloor” + i]._yscale = Yscale;
this[“nFloor” + i]._xscale = Xscale;
this.attachMovie(“dtext”, “dtext” + , i + 100, {_x:txtxpos, _y:this[“nFloor” + i]._y - 5});
this[“dtext” + i].textformatting.text = i + 1;
this.attachMovie(“sfText”, “sfText” + , i + 1000, {_x:sftxtxpos, _y:this[“nFloor” + i]._y+20});
}
if (tenantAmt == “5”)
{
this.attachMovie(“quint”, “nFloor” + , i, {_x:xpos, _y:ypos});
ypos -= this[“nFloor” + i]._height / divider;
this[“nFloor” + i]._yscale = Yscale;
this[“nFloor” + i]._xscale = Xscale;
this.attachMovie(“dtext”, “dtext” + , i + 100, {_x:txtxpos, _y:this[“nFloor” + i]._y - 5});
this[“dtext” + i].textformatting.text = i + 1;
this.attachMovie(“sfText”, “sfText” + , i + 1000, {_x:sftxtxpos, _y:this[“nFloor” + i]._y+20});
//trace([“dtext” +i]);
}
if (tenantAmt == “6”)
{
this.attachMovie(“sex”, “nFloor” + , i, {_x:xpos, _y:ypos});
ypos -= this[“nFloor” + i]._height / divider;
this[“nFloor” + i]._yscale = Yscale;
this[“nFloor” + i]._xscale = Xscale;
this.attachMovie(“dtext”, “dtext” + , i + 100, {_x:txtxpos, _y:this[“nFloor” + i]._y - 5});
this[“dtext” + i].textformatting.text = i + 1;
this.attachMovie(“sfText”, “sfText” + , i + 1000, {_x:sftxtxpos, _y:this[“nFloor” + i]._y+20});
//trace([“dtext” +i]);
}
sfTextArray.push(“sfText” + i);
if (spaces == “1”)
{
this[“nFloor” + i].gotoAndStop(“one”);
}
if (spaces == “2”)
{
this[“nFloor” + i].gotoAndStop(“two”);
}
if (spaces == “3”)
{
this[“nFloor” + i].gotoAndStop(“three”);
}
if (spaces == “4”)
{
this[“nFloor” + i].gotoAndStop(“four”);
}
if (spaces == “5”)
{
this[“nFloor” + i].gotoAndStop(“five”);
}
if (spaces == “6”)
{
this[“nFloor” + i].gotoAndStop(“six”);
}
}
// [COLOR=red]how do I write the below code w/o coping/pasting thousands of lines of code and to get the initial alpha properties to work correctly ?
[/COLOR]nFloor*.first1. _alpha = 0;
nFloor*.second1._alpha = 0;
nFloor*.third1._alpha = 0;
nFloor*.fourth1._alpha = 0;
nFloor*.fifth1._alpha = 0;
nFloor*.sixth1._alpha = 0;
nFloor0.first1.onRollOver=function(){
this[“nFloor”+*].first1._alpha = 100;
sfText0.gotoAndPlay(“go”)
sfText0.mtclip.text=floorTXT[0][0];
trace(_parent.sfTextArray);
}
first1.onRollOut = function()
{
sfText0.gotoAndStop(“hold”)
first1._alpha = 0;
trace(“rollout”);
};
second1.onRollOver = function()
{
second1._alpha = 100;
trace(“rolled”);
};
second1.onRollOut = function()
{
second1._alpha = 0;
trace(“rollout”);
};
third1.onRollOver = function()
{
third1._alpha = 100;
trace(“rolled”);
};
third1.onRollOut = function()
{
third1._alpha = 0;
trace(“rollout”);
};
fourth1.onRollOver = function()
{
fourth1._alpha = 100;
trace(“rolled”);
};
fourth1.onRollOut = function()
{
fourth1._alpha = 0;
trace(“rollout”);
};
fifth1.onRollOver = function()
{
fifth1._alpha = 100;
trace(“rolled”);
};
fifth1.onRollOut = function()
{
fifth1._alpha = 0;
trace(“rollout”);
};
sixth1.onRollOver = function()
{
sixth1._alpha = 100;
trace(“rolled”);
};
sixth1.onRollOut = function()
{
sixth1._alpha = 0;
trace(“rollout”);
};