I've created an instance of the TileList, and need too change the alpha of a textfield that appears inside the movie clips. How do I access a movieclip inside of the TileList so I can update the text alpha?
var backgroundList:TileList = new TileList();
// Add four images to the TileList instance
backgroundList.addItem({source:"bg1_mc"});
backgroundList.addItem({source:"bg2_mc"});
backgroundList.addItem({source:"bg3_mc"});
backgroundList.addItem({source:"bg4_mc"});
backgroundList.addItem({source:"bg5_mc"});
backgroundList.addItem({source:"bg6_mc"});
backgroundList.addItem({source:"bg7_mc"});
backgroundList.addItem({source:"bg8_mc"});
backgroundList.addItem({source:"bg9_mc"});
backgroundList.addItem({source:"bg10_mc"});
// Set scroll bar direction
backgroundList.direction = ScrollBarDirection.HORIZONTAL;
preview_mc.addChild(backgroundList);
This does not work:
preview_mc.backgroundList.bg1_mc.text_txt.alpha = 0;
this does not work:
preview_mc.backgroundList[1].text_txt.alpha = 0;
this does not work:
var foo=backgroundList.getItemAt(1).source;
foo.text_txt.alpha = 0;
I'm really at a loss. I've been searching for a solution everywhere for 4 hours and the TileList component is poorly documented.
Unfortunately, there doesn't seem to be a method to access the contents of a
TileList.What you're accessing when you use
getItemAtis actually theObjectyou added usingaddItem.So when you call
backgroundList.getItemAt(1).sourceall you're getting back is theString"bg2_mc" which is just the linkage identifier of the symbol of your library, not the instance of that symbol that was added to the display list.Not only is there no way in the API to do this, even traversing the entire display list of the
TileListdoesn't come up with any answers:There doesn't appear to be any trace of the MovieClips that were added.
This shows us that the
TileListis comprised of 2 instances ofScrollBarand oneSprite, and that theSpritehas a single childSpritewhich has no further children.