pseudo.ScrollPane class
View Sample :: Return to index  
pseudo.ScrollPane.ScrollPane(pThis:MovieClip)
ScrollPane constructor. You never use the constructor to create this component.

Parameters None
Returns Nothing
Example
    None


pseudo.ScrollPane.create(pOwner:MovieClip, strName:String, nDepth:Number):pseudo.Edit
Use this static function to create new ScrollPane on the specified movie clip. Never use constructor directly to do it.

Parameters pOwner The movie clip on which the new ScrollPane will be drawn.
strName The new ScrollPane instance name.
nDepth The new ScrollPane instance depth.
Returns The reference to new ScrollPane instance
Example
    //create pseudo.ScrollPane instance
    var spane:pseudo.ScrollPane = pseudo.ScrollPane.create(_root, "spane", 1);

    //set ScrollPane movie clip size
    spane.setSize(400, 300);

    //set the movie content for the ScrollPane instance
    //where the image will be displayed. Function setContent() returns the
    //reference to that content
    var pict:pseudo.BaseMovie = spane.setContent();

    // Create image movie clip using the image that was imported to the library
    //in our example image graphic is stored in the library with the id "pict"
    var img:MovieClip = pict.attachMovie("pict", "pict", 2);

    // add the listener to the content that would be handling the "size event"
    pict.addListener("size", _root, function(){ pict.setSize(img._width, img._height); });

    //Apply the skin to the scroll pane
    spane.setLook(pseudo.look.XPLook.getInstance())

    //Create the button that will be zooming the image

    var btnPlus:pseudo.PushButton = pseudo.PushButton.create(_root, "btnPlus", 2);
    btnPlus.setSize(20, 20);
    var lbl:pseudo.Label = pseudo.Label(btnPlus.addItem(pseudo.Label));
    lbl.setText("+");
    lbl.setAlign("center");
    btnPlus.setLook(pseudo.look.XPLook.getInstance());
    btnPlus.update();
    btnPlus.draw();
    btnPlus.addListener("mouseRelease", _root, function()
    {
    img._xscale = img._yscale = img._xscale + 10;
    spane.setUpdated(false);
    spane.update();
    spane.draw();
    }
    );

    //Create the button that will be zooming out the image

    var btnMinus:pseudo.PushButton = pseudo.PushButton.create(_root, "btnMinus", 3);
    btnMinus.setSize(20, 20);
    var lbl:pseudo.Label = pseudo.Label(btnMinus.addItem(pseudo.Label));
    lbl.setText("-");
    lbl.setAlign("center");
    btnMinus.setLook(pseudo.look.XPLook.getInstance());
    btnMinus.update();
    btnMinus.draw();
    btnMinus.addListener("mouseRelease", _root, function()
    {
    img._xscale = img._yscale = Math.max(5, img._xscale - 10);
    spane.setUpdated(false);
    spane.update();
    spane.draw();
    }
    );

    //Position the minus button
    btnMinus._y = btnPlus._y + btnPlus.getH();

    //Calling these functions will finally draw the component
    spane.update();
    spane.draw();

    // This code will draw the ScrollPane using XP look and feel skin.
    // Please notice that you should always use some skin to create the component,
    // this can be done like in this example, and the skin will be complied into the swf file,
    // or you can use another technique and load the skin at a run time.
           


pseudo.ScrollPane.setContent(pClass:Function):pseudo.BaseMovie
Creates the ScrollPane content movie clip and returns the reference to it.

Parameters pClass Function value
Returns pseudo.BaseMovie instance
Example
    None


pseudo.ScrollPane.setContent(pClass:Function):pseudo.BaseMovie
Sets the content offset within the scrollable area

Parameters nX Number value; horizontal offset .
nY Number value; vertical offset.
Returns Nothing
Example
    None
Flash UI Components (c)TUFaT.com, All Rights Reserved.