# \[Flash 8 Actionscript\]: Help with loading dynamic movieclips into ScrollPane

**URL:** https://forum.kirupa.com/t/flash-8-actionscript-help-with-loading-dynamic-movieclips-into-scrollpane/220697
**Category:** flash
**Created:** [March 28, 2007, 1:15pm UTC](https://forum.kirupa.com/t/flash-8-actionscript-help-with-loading-dynamic-movieclips-into-scrollpane/220697 "2007-03-28T13:15:32Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![roody](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@roody](https://forum.kirupa.com/u/roody)
#### Post date: [March 28, 2007, 1:15pm UTC](https://forum.kirupa.com/t/flash-8-actionscript-help-with-loading-dynamic-movieclips-into-scrollpane/220697/1 "2007-03-28T13:15:32Z")

</div>

Hi all-

I’m a beginner with Actionscripting, and struggling a lot with this issue.

What I’ve done: I’ve created a movieclip (”individual\_listing”) in my library that has three dynamic text fields. I parse my XML using loops and “if” statements to fill in the appropriate data. Using “attachMovie,” the “individual\_listing” movieclip repeats (so that it looks like a table with three columns and as many “rows” (i.e. attached movieclips) as needed.

What I want to do:My XML/movieclip “table” is too long; it needs to be scrollable. I am trying to load the “individual\_listing” movieclips into an empty movieclip called “scrollMovieClip” that I rename to a movieclip variable called, “container\_listing” that is set to scrollPane.content. I can’t get this to work. (Have tried creating both “scrollMovieClip” and “container\_listing” in the library and exporting for Actionscript, and also tried to create it inside the scrollPane on the fly. Neither way seems to work.)

Relevant code is the following:  
(p.s., this all is supposed to happen on a mouse event — when the user clicks the “00tab” movieclip, I want the scrollable table to display).

[SIZE=1]tab00.onRelease = function () {[/SIZE]  
[INDENT][SIZE=1]scrollPane.contentPath = “scrollMovieClip”;  
[/SIZE][SIZE=1]container\_listing:MovieClip = scrollPane.content;[/SIZE][/INDENT] [INDENT][SIZE=1]var listingDepth=100;[/SIZE]  
[SIZE=1]var countryName = childCountry[m].firstChild.firstChild.nodeValue;[/SIZE]  
[SIZE=1]var yearName = childCountry[m].firstChild.nextSibling.firstChild.nextSibling.fir stChild.firstChild.nodeValue;[/SIZE]  
[/INDENT][INDENT][SIZE=1]if ((countryName == “France”) && (yearName == “2000″)) {[/SIZE]  
[SIZE=1]  
[/SIZE]  
[SIZE=1]//Populate dynamic text fields in mc with data  
[/SIZE]  
[SIZE=1]  
[/SIZE]  
[INDENT][SIZE=1]individual\_listing.bank\_ txt.text = childCountry[m].firstChild.nextSibling.firstChild.nextSibling.fir stChild.nextSibling.firstChild.nextSibling.firstChild.nodeValue;[/SIZE]  
[SIZE=1]  
[/SIZE]  
[SIZE=1]individual\_listing.project\_txt.text = childCountry[m].firstChild.nextSibling.firstChild.nextSibling.fir stChild.nextSibling.lastChild.firstChild.nodeValue ;[/SIZE]  
[/INDENT][INDENT][SIZE=1]individual\_listing.amoun t\_txt.text = childCountry[m].firstChild.nextSibling.firstChild.nextSibling.fir stChild.nextSibling.firstChild.nextSibling.nextSib ling.firstChild.nodeValue;[/SIZE]  
[/INDENT][SIZE=1]//attach populated mc inside movieclip variable set to scrollPane.content  
[/SIZE]  
[INDENT][SIZE=1]container\_listing.attachMovie (”individual\_listing”, “individual\_listing”, container\_listing.getNextHighestDepth (), {\_y : (listingDepth) , \_x : (490)});[/SIZE]  
[/INDENT][SIZE=1]//Moves next dynamic movie clip down a spot[/SIZE]  
[INDENT][SIZE=1]listingDepth += individual\_listing.\_height + 2;[/SIZE]  
[/INDENT][INDENT][SIZE=1] }  
[/SIZE][/INDENT][SIZE=1]scrollPane.invalidate();[/SIZE]  
}  
[/INDENT] [SIZE=1] }[/SIZE]

[SIZE=1][SIZE=2]Any ideas? Help desperately needed…[/SIZE]  
[/SIZE]
