startDrag();
- Started
- Last post
- 7 Responses
- ********
Okay guys, I have 3 instances of chart MC on the stage; they're called chart1,chart2,chart3.
Inside chart is a button called 'butt'
onPress I want drag and onRelease I want stoppage.It works if I don't use the 'for' loop...Any help? I also can't get the relative targeting to work inside MX's newer dot syntax. thanks in advance. CODE FOLLOWS:
for (i=1; i<4; i++) {
_root["chart"+i].butt.onPress = function() {
_root["chart"+i].butt.startDrag...
};
_root["chart"+i].butt.onRelease = function() {
_root["chart"+i].stopDrag();
};
}
- ********0
bumpity bump.
- goygoygoy0
i'm not an expert but there is something strange in the way you name your fonction in the "for" seems strange, and... when do you call that fonction?
it's morning here, i'm stilll sleeping so mail it if you want, so i can look at it.
[°V°]
- autonoma0
for (i=1; i<4; i++) {
_root["chart"+i].butt.onPress = function() {
startDrag(this._parent,false);
}
_root["chart"+i].butt.onRelease = function() {
stopDrag();
}
}
- CyBrainX0
If, autonoma's script doesn't work try this.
Shouldn't there be a period after the _root ?
Try putting all your charts in one movie clip with a button with four separate hit states where you want your draggable areas to be.
Reconsider pressing a butt in drag.
- ********0
you wouldn't really need a button either.....
MovieClip.onPress = function{
this.startDrag();
}
- autonoma0
It works, CyBrainX. I pretty much always run a quick test on the Flash code I post.
"Shouldn't there be a period after the _root?"
No.
- Geith0
goygoygoy-
i think it's strange you call function "fonction."
;)