A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [RESOLVED] Dynamic Scrollpane not scrolling

  1. #1
    Member
    Join Date
    Apr 2001
    Location
    Cape Town
    Posts
    99

    resolved [RESOLVED] Dynamic Scrollpane not scrolling

    Hi, am am building a dynamic timeline loaded using xml. The content is build in class dateline and displays correctly in scroll pane, except that it does not scroll.

    Code:
    package MyClasses{
    	import flash.display.MovieClip;
    	import flash.net.URLRequest;
    	import flash.display.Sprite;
    	import fl.containers.ScrollPane;
    	import fl.controls.ScrollPolicy;
    	public class Main extends MovieClip {
    		private var sp:ScrollPane = new ScrollPane();
    		private var spSource:Sprite  = new Sprite();
    		private var req:URLRequest;
    		private var xml:XMLReader;
    		private var dateLine:DateLine;
    		public function Main() {
    			
    			sp.horizontalScrollPolicy = ScrollPolicy.AUTO
    			sp.verticalScrollPolicy = ScrollPolicy.AUTO
    			sp.setSize(550,400);
    			req = new URLRequest("MyClasses/assets/xml/data.xml");
    			xml=new XMLReader();
    			xml.load(req);
    			dateLine = new DateLine(xml);
    			spSource.addChild(dateLine);
    			sp.source = spSource;
    			sp.update();
    			addChild(sp);
    		}
    	}
    }

  2. #2
    Member
    Join Date
    Apr 2001
    Location
    Cape Town
    Posts
    99
    Just tried another solution that seems to solve the problem. Instead of adding the scroll pane to main class, I added it to the dateline class and then addChild(dateline) to stage.

    If any other option it would be on interest, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center