PDA

View Full Version : scrollTrack


Maik
03-18-2003, 04:06 PM
Hi!

How do i place the scrollTrack on to the left side of ScrollPane??

I know it's possible for the ScrollBar, but for ScrollPane?

thanx for any tip! :)


Maik

tost
03-18-2003, 07:42 PM
i needed to do that a few weeks ago, but i needed the scrollBar not totally left but in the center of the scrollPane, here's my fix:

open up the scrollpane component, and find this part in the code in the first frame:


FScrollPaneClass.prototype.initScrollBars = function()
{
this.hScrollBar_mc._y = this.height-this.hScrollBar_mc._height;
this.hScrollBar_mc.setSize(this.hWidth);
this.hScrollBar_mc.setScrollProperties(this.hWidth , 0, this.contentWidth-this.hWidth);
this.vScrollBar_mc._visible = (this.hWidth==this.width) ? false : true;
this.vScrollBar_mc._x = this.width-this.vScrollBar_mc._width;
this.vScrollBar_mc.setSize(this.vHeight);
this.vScrollBar_mc.setScrollProperties(this.vHeigh t, 0, this.contentHeight-this.vHeight);
this.hScrollBar_mc._visible = (this.vHeight==this.height) ? false : true;
}


and replace it by this:


FScrollPaneClass.prototype.initScrollBars = function()
{
this.hScrollBar_mc._y = this.height-this.hScrollBar_mc._height;
this.hScrollBar_mc.setSize(this.hWidth);
this.hScrollBar_mc.setScrollProperties(this.hWidth , 0, this.contentWidth-this.hWidth);
this.vScrollBar_mc._visible = (this.hWidth==this.width) ? false : true;

this.vScrollBar_mc._x = this.width-this.vScrollBar_mc._width;

// ************************************************** ********************************

// tost edit
this.vScrollBar_mc._x += _root.extraScrollOffset/(this._xscale/100);
// end tost edit

// ************************************************** ********************************

this.vScrollBar_mc.setSize(this.vHeight);
this.vScrollBar_mc.setScrollProperties(this.vHeigh t, 0, this.contentHeight-this.vHeight);
this.hScrollBar_mc._visible = (this.vHeight==this.height) ? false : true;
}


now use a variable called extraScrollOffset on the main timeline to shift your scrollbar to the left, eg 100 pix:

_root.extraScrollOffset = -100;


cheers :)
tost

Maik
03-19-2003, 06:55 AM
Hey tost!


Thx for your help!!!

Very cool!! :)

I know the prototype's, and also i found the initScrollBars function.
But i'm not so familiar with this stuff!

But with your fix, its very easy for me!

_root.extraScrollOffset = -this.myScrollPane._width;

will place the track on the left site!! [*jump*]




cheers

MAIK

tost
03-19-2003, 07:07 AM
my pleasure, maik, and welcome aBoard! :)

Maik
03-19-2003, 07:10 AM
:D

exigent
06-29-2004, 09:34 PM
how do you open a components code? when i drag onto the stage, edit is grayed out, and i can't edit from library either... any idea?

poperszky
07-28-2004, 03:42 AM
right click > edit in place

Truthtob
12-12-2005, 01:14 PM
In MX 2004 you can't edit components. Its all in the class files.

In MX 2004, if you want to position the scrollbar within the ScrollPane you can access the scrollBar movie clip within the ScrollPane at runTime.

I don't think this is documented but it works.

_root.scrollPane1.vScroller._x = 0;

you might also want to offset the content so you dont cover up anything inside the scrollPane

_root.scrollPane1.setHPosition(-15);

Obviously, you can also refer to hScroller as well. If you look inside the scrollPane.as class file, you can see all sorts of properties, methods and objects that are actually accessable through actionscript.

brian

malx
02-20-2008, 04:17 PM
im having this problem too. i cant edit in place. im using flash cs3, trying to get the scrollbar to work on the left side.