Any good actionscripters?
Posted: Tue Aug 02, 2011 2:02 pm
My mind is blanking on how to do this right. It's been a while since I have done much AS3.
I have a movieclip that contains 4 different states. Each on an individual keyframe. Content needs to be added to each of these states, however you can't do that because the state doesn't exist on the frame where you're adding content. A loop runs through multiple instances of this movieclip to add content to.
Simplified and shortened version (gets error because target "textFillArea1" doesn't exist when this runs):
function contentMedia ()
{
var textFillArray:Array = new Array(Lots of things in here);
var contentSelector:MovieClip;
for (var i:int; i<textFillArray.length; i++)
{
var textFillBox1:TextField = new TextField();
textFillBox1.htmlText = textFillArray[i];
contentSelector = MovieClip(contentPanel.getChildByName("contentArea" + i));
contentSelector.textArea.textFillArea1.addChild(textFillBox1);
}
}
Any ideas?
I have a movieclip that contains 4 different states. Each on an individual keyframe. Content needs to be added to each of these states, however you can't do that because the state doesn't exist on the frame where you're adding content. A loop runs through multiple instances of this movieclip to add content to.
Simplified and shortened version (gets error because target "textFillArea1" doesn't exist when this runs):
function contentMedia ()
{
var textFillArray:Array = new Array(Lots of things in here);
var contentSelector:MovieClip;
for (var i:int; i<textFillArray.length; i++)
{
var textFillBox1:TextField = new TextField();
textFillBox1.htmlText = textFillArray[i];
contentSelector = MovieClip(contentPanel.getChildByName("contentArea" + i));
contentSelector.textArea.textFillArea1.addChild(textFillBox1);
}
}
Any ideas?