PDA

View Full Version : re movclips to a scrolling area


mcbreenmachine
03-28-2002, 01:32 PM
Are there any examples out there using attachMovielip and place them inside a scrollable area.

ie placing a series of movieclip links into a scrolling movieclip

mcbreenmachine
03-28-2002, 03:11 PM
Does anybody have anything on adding clips to a scrolling area.

farafiro
03-28-2002, 03:24 PM
Okey, what do u mean by that?? do u want to have buttons to scroll MC's

mcbreenmachine
03-28-2002, 03:37 PM
I have the following xml menu system.

http://212.120.137.170/as/move.html

It loads sections first. Each section in turn has it's own lessons.
The lessons have a tendency to become more than ten per section. So for design purposes I would like them to be loaded into a scrollable area - so when there is more than five of them in the area one can scroll down to the rest.

Brian

mcbreenmachine
03-28-2002, 04:31 PM
this site has what i mean

www.2advanced.com

They create scrollable areas filled with I presume text

I want to add clips instead of text and scroll them

brian

farafiro
03-31-2002, 06:49 AM
Use the same technique of the text scrolling tut but with a big MC that contains all the other mc's and use a MASK to limit the viewable area

mcbreenmachine
04-04-2002, 07:55 AM
Do you have an example of this by any chance.

megamulli
09-28-2006, 08:05 PM
You cannot use attachMovieClip to put a MovieClip into a scrollable area directly. Here is a small tutorial I wrote that explains how to attach content dynamically to a scrollable area at runtime. Hope this helps.

1. Create an empty movie clip and put it in your library, giving it a linkage ID.

2. From the components panel to your library, add a ScollPane component along with all other components and MovieClips you
will use.

3. In your code, attach the ScrollPane and set its content property to the linkage ID of the empty movie clip you created.

4. Now you can attach clips dynamically to the ScrollPane during runtime. Just attach each clip to the ScrollPane's content
property just like you would any Movieclip.

5. After you attach your components, invoke the ScrollPane's invalidate() method.

Example code:

// container is the linkage id of the empty MovieClip.
this.scrollPane = this.createClassObject(ScrollPane, "scrollPane", this.getNextHighestDepth());
this.scrollPane.setSize(350, 150);
this.scrollPane.move(50, 50);
this.scrollPane.contentPath = "container";

var lblLastName:Label = this.scrollPane.content.createClassObject(Label, "label1", 0);
lblLastName.autoSize = "left";
lblLastName.text = "Last Name";
lblLastName.move(lblLastName.x + 5, lblLastName.y + 5);

this.txtLastName = this.scrollPane.content.createClassObject(TextInpu t, "lastname", 1);
this.txtLastName.setSize(200, 25);
this.txtLastName.move(lblLastName.width, lblLastName.y);

this.scrollPane.invalidate();