View Poll Results: Was this post clear and to the point?
- Voters
- 1. You may not vote on this poll
-
Wait what? say that again....complete jibberish
-
i don't think u knwo what yoru talking about
-
you could clarify your post better
-
VERY CLEAR POST!
-
This is the exact same problem. FADER is a variable, after the loop, FADER will always be the last thing it was set to, which is the clip with the last name in your array. In dragScroll, you have to use evt.currentTarget to get the one which is being moused down on. In loop... I have no idea what you're trying to do with loop, but you shouldn't use FADER in it.
and in dropScroll, you have a syntax error (":" instead of "."), and you shouldn't be using FADER.
And again, it's simpler if you put the actual clips in your array instead of their names.
I think you want to keep a reference to the one currently dragged, and you are using FADER instead of this.
You have a variable which should be outside the loop inside it (draging (which is misspelled)). You also have some addEventListener lines which should only be done once inside the loop. Don't do things that should only be done once inside a loop.
And I think you're trying to have a bounds for each fader, but you only have one variable for it.
Code:
var FADERarray:Array=new Array(fader1,fader2,fader3,fader4,fader5);
var currentFader:MovieClip;
var dragging:Boolean=false;
addEventListener(Event.ENTER_FRAME, loop);
stage.addEventListener(MouseEvent.MOUSE_UP, dropScroll);
for (var iFADER:uint; iFADER< FADERarray.length; iFADER++) {
var FADER:MovieClip=FADERarray[iFADER];
FADER.addEventListener(MouseEvent.MOUSE_DOWN, dragScroll);
FADER.buttonMode = true;
FADER.bounds = new Rectangle(FADER.x,795,0,205); //works because it's a dynamic class. otherwise declare this property.
}
function dragScroll(evt:MouseEvent):void{
currentFader = MovieClip(evt.currentTarget);
currentFader.startDrag(false,currentFader.bounds);
dragging=true;
}
function loop(e:Event):void{
var bounds:Rectangle = currentFader.bounds;
svalue.text=String(Math.round((currentFader.y-bounds.bottom)/(bounds.top-bounds.bottom)*8.00));
}
function dropScroll(evt:MouseEvent):void{
currentFader.stopDrag();
dragging=false;
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|