Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-31-2011, 10:36 AM   #1
Join Date: Mar 2009
Posts: 75
Default [AS3] ScrollPane issue...

Hey, so this is pretty basic i'm guessing but it's annoying me because i can't work it out.

I have 30 MovieClips inside of another MovieClip called "containerx"

I have a ScrollPane called "mySP" and it scrolls the containerx

'mySP.source = containerx'

now, this is the part i cant work out. I won't always need to use all 30 mc's inside of the containerx, so the ones i'm not using i'm using the "removeChild()" method to get rid of them...

So far, what i've worked out is that i have to put the removeChild code in the containerx because it has to be within the parent... that's fine... but i need to set the source of the mySP AFTER i removeChild... otherwise there is a lot of blank space in my scrollPane where the other mc's used to be...

all following so far?

So what i tried to do is set the source of mySP after i removed child, but to do this i have to access it on the stage from inside my containerx.

I done that by using this code:

ActionScript Code:
MovieClip(parent).mySP.source = this;

it works! but it gives me this Compile Error:

ComponentShim (Compiled Clip), Line 1 Warning: 5002: The frame scripts of the symbol 'ScrollPane' have been ignored because a compiled clip contains a definition for fl.containers.ScrollPane. To override the fl.containers.ScrollPane definition, place a custom class file within your classpath.

Nooo idea what that means or if my code is even right... but it works...


Incase you didn't full understand, here it is again.

There are 30 buttons inside of a mc called containerx

If i only need 20 buttons, i'll use 'removeChild' to remove the last 10.

i have to put the 'removeChild' method inside of the containerx

i need to set the scrollPanes source to containerx after the removeChild.

How do i do this correctly?

Thank you!

popnfresh24 is offline   Reply With Quote
Old 07-31-2011, 10:42 AM   #2
Learning Fast
audiopro's Avatar
Join Date: Dec 2009
Location: Morecambe
Posts: 755

Why not just create the number of MC's required, at runtime?
audiopro is offline   Reply With Quote
Old 07-31-2011, 01:32 PM   #3
Join Date: Mar 2009
Posts: 75

For the purpose i'm using this for, i figured that this is the most easiest way to do it. They are already on the stage and whoever uses it will name them, and then the ones that are unnamed will be removed.
popnfresh24 is offline   Reply With Quote
Old 07-31-2011, 03:09 PM   #4
Join Date: Mar 2009
Posts: 75

Answered my own question again... lol...

i found that i can just remove the child movieclip externally using:

ActionScript Code:
popnfresh24 is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT. The time now is 06:33 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.