PDA

View Full Version : Scroller Not Working



tomyknoker
10-10-2006, 04:08 AM
I have been using a great scroller but for some reason if I use more than one on the stage the others become disabled... Any Ideas? File is attached for those interested...

BLiZZaRD
10-10-2006, 08:56 AM
Can't look at the file as I am at work, but make sure you give each an instance name, a different instance name, and run your code for each.

If you have 3 MCs on stage and all are called "box" and you have one code that tells "box" what to do, it will only work on the highest level "box"

But if you name them box1, and box2, etc then adjust your code accordingly it should be all dasies and sunshine :)

tomyknoker
10-10-2006, 09:56 AM
Can't look at the file as I am at work, but make sure you give each an instance name, a different instance name, and run your code for each.

If you have 3 MCs on stage and all are called "box" and you have one code that tells "box" what to do, it will only work on the highest level "box"

But if you name them box1, and box2, etc then adjust your code accordingly it should be all dasies and sunshine :)Yea it's really wierd... I've tried all that and even duplicated the entire mc so it was totally independent of the others... I'm guessing it's the code... Probaby simple but not sure... Could it be something to do with _parent?


fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=false;
space = 20;
friction = 0.9;
speed = 4;
y = dragger._y;
top = main._y;
bottom = main._y+mask_mc._height-main._height-space;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
this._parent.dragger._y = this._parent._ymouse;
this._parent.dragger._y = this._y+this._height-this._parent.dragger._height;
} else {
this._parent.dragger._y = this._parent._ymouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
} else {
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-main._y)/speed)*friction);
main._y += dy;
};
};
Actually is it to do with 'prototype', what the hell is prototype? :\

BLiZZaRD
10-10-2006, 11:42 AM
Uggg, that code is scary. Let me get home and I will run it through a code exploder. You are running version 8 correct?

tomyknoker
10-10-2006, 02:46 PM
Uggg, that code is scary. Let me get home and I will run it through a code exploder. You are running version 8 correct?Yea that's right... Yea it's scary... It works well though when it runs :confused:

BLiZZaRD
10-11-2006, 09:14 AM
No offense ment, as I am not being much help as of late, but...

what did you do to piss off everyone at FK? None of your posts have been answered, LOL

Granted I am only one man and your Flash experience is starting to delve into the unknown for me as well, but I am trying to help you out, but FK is pretty good about answering posts unless you do something they don't like :D

tomyknoker
10-11-2006, 10:55 AM
No offense ment, as I am not being much help as of late, but...

what did you do to piss off everyone at FK? None of your posts have been answered, LOL

Granted I am only one man and your Flash experience is starting to delve into the unknown for me as well, but I am trying to help you out, but FK is pretty good about answering posts unless you do something they don't like :Dhaha none taken... i agree! a few years back there were lots of replies, i'm thinking it's the same for eveyone?? or atleast that's what i tell myself so i can sleep at night :D

did you have any luck with that code?

BLiZZaRD
10-11-2006, 12:22 PM
Actually no I didn't get a chance, got a cold that knocked me out most of the morning and then I had football meetings for the coaches and tomorrow/later today I have work meetings and more coaches crap. I am trying to get to it, promise!

tomyknoker
10-11-2006, 02:27 PM
Too much to do too little time! :p

Whenever you get a chance is great! I'm hopeful you'll be able to work this crazy code out!

BLiZZaRD
10-12-2006, 09:10 AM
Would it be at all possible for you to zip and send everything you have that you are working on? it might take me a bit longer, as I would probably rewrite most of the code to get everything to work, but seeing it in pieces isn't helping.

If that is a problem I understand and will do what I can with this anyway. :)


If you like you can PM me the link so its not out there for everyone, just an option.