-
While MouseDown
'Lo
I'm kinda stuck with a little script I'm writing
I've already got a function defined that duplicates an MC... with some extra code too, but I want the function to be run every time the frame refreshes whilst the mouse-button is held down
I figured its got something to do with the Mouse.AddListener() method, but I can't figure it out
Right now I'm using:
PHP Code:
Brush.onMouseDown = function(DupStroke) {
n++;
rokx = _root._xmouse;
roky = _root._ymouse;
duplicateMovieClip("Stroke", "stroke"+n, n);
_root["stroke"+n]._x = rokx;
_root["stroke"+n]._y = roky;
};
But this only works once... when the button is clicked
I want to be to duplicated whilst the button is held down
Any ideas? (this has gotta be an easy one)
-W3bbo
<!-- Added -->
Hmm, it would appear another posting appears from me directly below this one from me, but with no content whatsoever... Probably a bug in the BB software... no, I was not double-posting for attention)
Last edited by W3bDevil; 07-19-2004 at 10:16 AM.
-
cake!
well if u want it to keep duplicating while the mouse is held down try adding a timer and checking if the mouse is still down within a certain time and if it is then run the function again
Skribble
Its not that im lazy, I just dont care.
-
Senior Member
code: brush.onMouseDown = function(){
_root.pushed = true;
}
brush.onMouseUp = function(){
_root.pushed = false;
}
brush.onEnterFrame = function(){
if(_root.pushed == true){
//do stuff
}else{
//do other stuff
}
}
Of course you will need to insert your code.
_t
-
Hmm, but could you use the Mouse.AddListener method at all?
-
Senior Member
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
|