hi all

i'm trying to implement a scrollbar using the built-in fl.controls.ScrollBar class but i'm not having much luck

i can get the scrollbar to react to a sprite but there's no built in method that will let the sprite react to the scrollbar (i've tried scrollTarget and scrollTargetName but they are both undefined in ScrollBar)

here is my scrollbar method so far

CODE
package com.receptacle.timeline
{
        //package imports
        import flash.display.Sprite;
        import flash.display.Shape;
        import flash.display.StageDisplayState;
        import flash.display.StageScaleMode;
        import fl.controls.ScrollBar;
        import fl.controls.ScrollBarDirection;
        import fl.controls.UIScrollBar;
        
        public class TimelineApp extends Sprite
        {
                // class variable declarations
                private var base:Sprite;
                private var timelineArea:TimelineArea;
                private var cp:CommonProperties;
                private var taPanelY:uint;
                private var taPanelHeight:uint
                
                // constructor
                public function TimelineApp()
                {
                        setVars();
                        setFullscreen();
                        addBaseSprite();
                        initialiseBackgroundElements();
                        initialiseMainTimeline();
                        initialiseEventNavigation();
                        initialiseTimelineScrollBar();
                }
                
                private function setVars()
                {
                        base                    = new Sprite()
                        cp                              = new 
CommonProperties();
                        taPanelY                = cp.taTitleBarY;
                        taPanelHeight   = cp.taTitleBarHeight + 
cp.taPanelHeight;

                }
                
                private function addBaseSprite():void
                {
                        addChild(base);
                }
                
                private function setFullscreen():void
                {
                        trace ("Fullscreen");
                        stage.displayState      = StageDisplayState.FULL_SCREEN;
                        stage.scaleMode         = StageScaleMode.NO_SCALE;
                }
                
                private function initialiseBackgroundElements():void
                {
                        trace ("Background elements initialised");
                        var backgroundElements:BackgroundElements = new 
BackgroundElements();
                        base.addChild(backgroundElements);
                }
                
                private function initialiseMainTimeline():void
                {
                        trace ("Main Timeline initialised");
                        timelineArea = new TimelineArea();
                        base.addChild(timelineArea);
                        
                        // mask
                        var taMask:Shape = new Shape();
                        taMask.graphics.beginFill(0xFF0000);
                        taMask.graphics.drawRect(0, taPanelY, 800, 
taPanelHeight);
                        base.addChild(taMask);
                        timelineArea.mask = taMask;
                }
                
                private function initialiseEventNavigation():void
                {
                        trace ("Event navigation initialised");
                }
                
                private function initialiseTimelineScrollBar():void
                {
                        trace ("Timeline scrollbar initialised");
                        var scrollBar:ScrollBar = new ScrollBar();
                        scrollBar.direction             = 
ScrollBarDirection.HORIZONTAL;
                        scrollBar.x                             = 10;
                        scrollBar.y                             = 550;
                        scrollBar.setSize(280, 40);
                        scrollBar.maxScrollPosition = timelineArea.width;
                        scrollBar.minScrollPosition = 0;
                        scrollBar.pageScrollSize = 800;
                        scrollBar.pageSize = 800;
                        trace("timelineArea.width is "+timelineArea.width);
                        addChild(scrollBar);
                }
        }
}
/CODE

timelineArea and backgroundElements extend Sprite

Do i need to extend the scrollbar class to accept a file or has adobe written the class to do it automatically?

if i need to extend it anyway, are there any better skinnable scrollbars out there that i can use

hope you can help
a





_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to