Hey guys,
Im recycling some script I used for a scroll bar a while back...minimal but ideal for my needs.
But I just cant get it to work in flash eight....here's my AS
ActionScript Code:
thumb_mc.onPress = function () {
this.gotoAndPlay(2);
//find the usable length of travel, which is the height of the track minus the height of the thumb
var travelLength = track_mc._height - this._height;
//make clip draggable
this.startDrag (false, 0, 0, 0, travelLength);
//scroll text in proportion to thumb position Croncast - frame:: The net effect is that IE will show a scrollbar unless you add frameborder=0. targeting their behavior over time may someday face related isues and requests. http://www.croncast.com/keyg/frameHOME | Halo Maps Forum:: USE MY SCROLL BAR! Posted: Dec 18, 2007 04:23 PM Msg. 7 of 6576 you have isues with me, and you constantly ask why others hate you. http://forum.halomaps.org/index.cfm?page=topic&topicID=14135forum?page=topic&topicID=14135HOME |
this.onMouseMove = function () {
//find the fraction of thumb's current position to its total travel length
var whereIsThumb = (this._y / travelLength);
trace(whereIsThumb);
//multiply text field's maxscroll by this fraction
_parent.newsContent.scroll = (_parent.newsContent.maxscroll + 1) * whereIsThumb;
//make this behavior independent of movie's frame rate
updateAfterEvent();
};
};
//clear the enterFrame and restore usingThumb variable
thumb_mc.onRelease = function () { shadow-discuss : Messages : 24326-24355 of 24924:: T|X doesnt have all the isues from Treo (since > these are also newer improve the speed of scrolling > (either using the scrollbar or cursor up/down) http://groups.yahoo.com/group/shadow-discuss/messages/24326?xm=1&m=e&l=1HOME | Open bugs in Paradox:: Printing a tableframe with a horizontal scroll bar in the record band in a report to be related to a couple of different isues. 1) Group bands are used. http://hem.bredband.net/bertilisberg/paradox/openbugs.htmHOME |
//go to "off" frame
this.gotoAndStop(1);
stopDrag ();
delete this.onMouseMove;
};
Source: http://www.nineironmusic.co.uk/test.zip
Any help much appreciated!
haha looks like i'm too late. oh well!
Thanks for looking dude ...its just kinda worked after a while...must of inadvertantly done somthing!
Thanks Steve...I literally worked this out a second ago!
However ...im now sucking the movie you have the source for into another ...and the scroller is no longer working.
I can only assume that im refering to clips using the wrong syntax ...anything obvious you could point out?
The problem is in your scrollbar movie your "track" is the same height as the dragger; basically increase your track height to match the height of your text box and it will work.
The code contains "this" a lot - that refers to the timeline the code is written on so make sure the objects referenced after "this" are actually on that timeline.
Same applies to _parent.newsContent (assumes the MC newsContent is one timeline out from where the code is written) and thumb_mc and track_mc (they must be on the same timeline as the code is written or flash won't be able to find them).
Nothing I could see.
Challenging Books For A 14 Year Old?
First guitar : acoustic or electric?
|