all groups > flash actionscript > may 2004 >
You're in the

flash actionscript

group:

How to target contents of ScrollPane?


How to target contents of ScrollPane? Nicholai
5/26/2004 9:24:11 PM
flash actionscript:
I have a scrollpane which loads a movie clip. I have a button at the root of
the movie which needs to target the content inside the scrollpane. How do I do
it?

I've tried

on(release) {
_root.scrollpane.my_MC.gotoAndStop(2);
}

scrollpane is the instance name of the ScrollPane component
my_MC is the movie clip which is loaded into the ScrollPane component

It seems so simple but it I can't make it work.
Re: How to target contents of ScrollPane? rlc5611
5/27/2004 7:22:11 AM
my_MC is not the name of the movie clip. It is the name of the clip that gets
loaded into the scrollpane's clip with the content path. Once you think about
this, it actually makes sense. The scrollpane has a constant name for the
movieclip holder although this name is different depending on which component
version you are using.

If you are using MX2004, try

on(release) {
_root.scrollpane.spContentHolder.gotoAndStop(2);
}
because "spContentHolder" is the name of the scrollpane's movie clip (the
latest component version);

If you are using MX (or an older component in MX 2004) try:

on(release) {
_root.scrollpane.tmp_mc.gotoAndStop(2);
}

To be absolutely sure what the name of the movie clip is for the version and
component you are using, temporarily place this script into the movie clip
being loaded into the scrollpane

mytruename = getProperty(this,_name);
trace(mytruename);

Once you are sure of the name, delete the script. Once you know the name, you
should be able to target it.

Re: How to target contents of ScrollPane? Nicholai
5/27/2004 1:42:04 PM
Dear rlc5611 -

Thank you so much. That was very helpful! Now I can get back to work again.

Have a great day -

AddThis Social Bookmark Button