I have a ScrollPane component to stage and I give it as source a new MovieClip instance. How can I access the movieclip inside scrollpane?
This is what I have so far but it returns null:
var regForm = new RegistrationForm();
regForm.name = "rForm";
regFormSP.source = regForm;
var form = Object(regFormSP.content).getChildByName("rForm");
trace(form) // returns null
UPDATE
If I list objects I get
_level0.regFormSP.instance20.rForm
There is an object “instance20” as a parent to rForm…Why is that?
instance 20is probably an unnamed container inside the scroll pane that Flash masks and scrolls. According to the docs, ScrollPane.content is a reference to the display object you assign using ScrollPane.source. Given that,regFormSP.contentshould be your form, and not child thereof.http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/containers/ScrollPane.html#content