Hey all,
I am in the process of learning AS 2, so I understand this may sound a bit noobish to some experts, but either way, I really would appreciate any help from anyone!
So I am using Kirupa’s scrollbar (http://www.kirupa.com/developer/flash8/scrollbar.htm) for a simple flash site, however, I have a navigation bar above the content scroller and each button links to a keyframe INSIDE the content scroller, so for example:
on (release) {
_root.contentMain.gotoAndStop(“services”);
}
This is the code I have on my services button outside of the scroller mc. The “services” tag is inside the content.
So this is not actually the problem. The buttons work fine and dandy and I am correctly taken to each tag when pressed by the correct button.
**My problem is this: If I scroll down part of the page, and I click a new button, the new page shows up, but it stays at the same level of scrolled material. If I scroll to the bottom of Home, and click Services, it will land on the services page, but stay at the bottom of it.
So basically what I want to do is have there be some sort of action on the button “resetting” the scrollbar to the top.**
If anyone can help me with this I would very much appreciate it. Here is the first part of the code from the scrollbar.
scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain._y = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._y+speed<maskedView._y) {
if (scrollFace._y<=top) {
scrollFace._y = top;
} else {
Since I’m only in the process of learning AS, I knew that
if (scrollFace._y<=top) {
scrollFace._y = top;
looked like an important piece of code,so I tried placing things like “scrollFace._y top;” under the on (release) part, but I knew it probably wouldn’t work. I know it must be pretty simple and I’ll end up feeling like an idiot, and anyone who ends up doing that, I really do appreciate it and thanks again!