Here is the situation codeWorld....i'm losing it .....in my brain the variables or items in a TileList component are arranged just like a high powered Array. The problem is I cant or dont remember a way to search it with code. I thought I could just put or use code like this to access the variables:
trace(myTileList.index[1].label);
To get the variable of in the second tile or any tile for that matter without it being selected. I already built this InstantMessenger using a TileList component and I dont want to go through all that code and re-build my own custom clip etc...blah blah...i digress but thats beside the point.
The point is how do i access a variable in the TileList through code like the code above...I tried using a DataProvider but it wont let me access the variables that way either.......help.....help....i'm dying..............................to know....
somebody save me ......i officially feel like a rookie now.
Array...TileList...H...TileList inherits SelectableList, so use getItemAt()
trace(myTileList.getItemAt(1).label)
Array...TileList...H...zammm.....i didnt think about that.....gonna try to incorporate that into my messenger..... ......i'll let you know if that works out for my madness
.......
...iT wErKs.......woooooooooooot!!!......thanks a million.....i owe you one.... .....i'll tapdance at yo wedding....just dont get married soon
for the record....i used a for loop to loop thru the list.....i needed it to see if a variable is equal to another....and if so execute another function....
as simple as it is.....i couldnt figure it out to save my life.......but thank to RayRay...or SugarRay...or what ever he nicknames himself ....lol...i'm on track now
sample code how i used it:
var example = ''randomname'';
for(var i=0; i%26lt;myTileList.length; i++)
{
?if(myTileList.getItemAt(i).label==example)
{
?executeFunction();
}
else {
?//do nothing
}
}//end for loop
thelegendaryghost
LOL. You're welcome.
No comments:
Post a Comment