Flash AS3 ScrollPane update problem

Posted on 2009-04-22
Last Modified: 2013-11-11
I wonder if anyone can help. I've created a flash object that builds up a set of dynamic movieclips based on XML data. That all works fine, however, as there will be variable amounts of data being imported, I want to place the dynamic movieclips inside a scrollpane that should scroll vertically. The problem is that the scrollpane is not displaying any scrollbars. The dynamic movieclips are being created within a 'holder' mc which is then used as the scrollpane source. I've tried using an update() once the content has loaded but that doesn't make any difference.

Any help would be very much appreciated!
import fl.containers.ScrollPane;

var xmlLoader:URLLoader = new URLLoader(); 

var xmlData:XML = new XML();

var strXML:String = "xmlsummary.xml";

var cell_spacing:Number = 0.4180;


xmlLoader.addEventListener(Event.COMPLETE, LoadXML); 


xmlLoader.load(new URLRequest(strXML)); 

var sp:ScrollPane = new ScrollPane();


var mcHolder:MovieClip = new MovieClip();


function LoadXML(e:Event):void { 

xmlData = new XML(; 

var acids:XMLList = xmlData.aminoacid;

for (var i=0; i<acids.length(); i++){

	var pro_mc:MovieClip = new mc_protein();

	pro_mc.y = 45*i+5;


	pro_mc.txtTitle.text = acids[i].@name;


	var item_count:Number = 0;


	var cells:XMLList = acids[i].item;

	for (var j=0; j<cells.length(); j++)


		if (cells[j].@type == "amino"){

			var cell_mc:MovieClip = new mc_black();

			cell_mc.x = item_count * cell_spacing;



			var feat:String = cells[j].modification;

			if(feat == "F"){

				cell_mc.mc_feat.visible = false;





			else if(cells[j].@type == "ipep"){

			var cell_mc:MovieClip = new mc_red();

			cell_mc.x = item_count * cell_spacing;



			var feat:String = cells[j].modification;

			if(feat == "F"){

				cell_mc.mc_feat._visible = false;









sp.source = mcHolder;

sp.addEventListener(Event.COMPLETE, completeHandler);

function completeHandler(event:Event):void{



Open in new window

Question by:MColebrook
    LVL 11

    Accepted Solution

    could you try this for me?

    place the script on line 61 within the loop.


    Author Closing Comment

    Many thanks greeneel - that worked perfectly!

    Author Comment

    Sorry - further info: I placed the code from line 61 at line 57 for it to work correctly.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    The goal of the tutorial is to teach the user how to how to record live broadcast.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now