Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Extensions and Plugins > Components

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-08-2010, 02:12 AM   #1
dwappes
Registered User
 
Join Date: Jan 2010
Posts: 20
Default [AS3] Reusing Scrollpane Component

I have about 10 pages (clips) that need the use of a scrollpane and am using the following AS3 script:

ActionScript Code:
scrollPane.source = home_mc; scrollPane.setSize(575,340);

This works great for one clip, but I would like to reuse it for other clips.

Can someone please give me an AS3 script example of how to reuse the scrollpane for other clips, or do I have to drag a new scrollpane component for each instance? Thanks.
dwappes is offline   Reply With Quote
Old 02-08-2010, 03:55 AM   #2
rondog
ActiveDen.net/user/rondog
 
rondog's Avatar
 
Join Date: May 2006
Location: San Diego
Posts: 579
Default

you would just set the source of the same scrollpane instance to another movie clip

so

scrollPane.source = home_mc;

can just as easily be changed out to

scrollPane.source = about_mc;
__________________
My activeden portfolio
My website
rondog is offline   Reply With Quote
Old 02-08-2010, 04:00 AM   #3
dwappes
Registered User
 
Join Date: Jan 2010
Posts: 20
Default

Do I need to redefine the size each time if I want it to always remain the same size?
dwappes is offline   Reply With Quote
Old 02-08-2010, 04:16 AM   #4
rondog
ActiveDen.net/user/rondog
 
rondog's Avatar
 
Join Date: May 2006
Location: San Diego
Posts: 579
Default

nah once you size it, its the same size until you resize it again
__________________
My activeden portfolio
My website
rondog is offline   Reply With Quote
Old 02-08-2010, 04:43 AM   #5
dwappes
Registered User
 
Join Date: Jan 2010
Posts: 20
Default

I tried that and it worked fine, then when I added script for my buttons I got the following error messages. So I removed the script for my buttons and continued getting the same errors. Do you know what I did wrong?

1026: Constructor functions must be instance methods.5000: The class 'fl.core.ComponentShim' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type. 5000: The class 'fl.controls.ScrollBar' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type. 5000: The class 'fl.containers.ScrollPane' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.

Last edited by dwappes; 02-08-2010 at 04:57 AM.
dwappes is offline   Reply With Quote
Old 02-08-2010, 09:43 AM   #6
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 10,682
Send a message via Skype™ to henke37
Default

Your flash install is corrupt. That or you forgot to link with the component symbols, be sure to include the component in the library.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 is online now   Reply With Quote
Old 02-08-2010, 04:34 PM   #7
dwappes
Registered User
 
Join Date: Jan 2010
Posts: 20
Default

I am linked to all the symbols & they are all in the library. Does that mean my Flash CS4 needs to be reinstalled or that I need to contact their technical support?
dwappes is offline   Reply With Quote
Reply


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 11:54 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.