mxyntl
05-04-2007, 06:23 AM
I sure could use some help with accessing a function in a nested
movieclip. I can't figure out what the target path needs to be to
call the function "collapseTree" (in the my_tree movieclip) from
the main stage in loader.fla.
This is a large file so here's a schematic of the code and
structure of loader.fla:
in loader.fla
this.createClassObject(mx.controls.Loader, "treeldr", 11);
treeldr.contentPath = "treemain";
treeldr.scaleContent = true;
treeldr.setSize(230, 140);
treeldr.move(435, 115);
/************************************************** */
treemain movieclip
tree_sp_mc on stage (scrollpane movieclip)
/************************************************** */
tree_sp_mc (scrollpane movieclip)
this.createClassObject(ScrollPane, "tree_sp", 20);
tree_sp.contentPath ="my_tree";
tree_sp.setSize(460, 285);
/************************************************** */
my_tree movieclip
// code to parse and load text into tree here
// this resets tree to original size
function collapseTree():Void {
text_tree.setSize(tree_width, tree_height);
}
/************************************************** */
I tried to create an instance of the "treemain" and "my_tree"
movieclips in AS but I couldn't figure out where the instances
would go since each one is loaded into the contentPath of the
loader and the scrollpane respectively.
I also tried making "collapseTree" a global variable on the main stage
to which I assigned the "collapseTree" function in "my_tree", but,
that didn't work either.
I've been wrestling with this for several days and I'm burned out
on it. Any help would be greatly appreciated.
movieclip. I can't figure out what the target path needs to be to
call the function "collapseTree" (in the my_tree movieclip) from
the main stage in loader.fla.
This is a large file so here's a schematic of the code and
structure of loader.fla:
in loader.fla
this.createClassObject(mx.controls.Loader, "treeldr", 11);
treeldr.contentPath = "treemain";
treeldr.scaleContent = true;
treeldr.setSize(230, 140);
treeldr.move(435, 115);
/************************************************** */
treemain movieclip
tree_sp_mc on stage (scrollpane movieclip)
/************************************************** */
tree_sp_mc (scrollpane movieclip)
this.createClassObject(ScrollPane, "tree_sp", 20);
tree_sp.contentPath ="my_tree";
tree_sp.setSize(460, 285);
/************************************************** */
my_tree movieclip
// code to parse and load text into tree here
// this resets tree to original size
function collapseTree():Void {
text_tree.setSize(tree_width, tree_height);
}
/************************************************** */
I tried to create an instance of the "treemain" and "my_tree"
movieclips in AS but I couldn't figure out where the instances
would go since each one is loaded into the contentPath of the
loader and the scrollpane respectively.
I also tried making "collapseTree" a global variable on the main stage
to which I assigned the "collapseTree" function in "my_tree", but,
that didn't work either.
I've been wrestling with this for several days and I'm burned out
on it. Any help would be greatly appreciated.