simple AS Q
- Started
- Last post
- 15 Responses
- Mojo
I want to dupe a MC everytime the mouse is clicked anywhere on stage.
I tried this:
_root.onMouseDown = function(){
i = i + 1;
eaglename = eaglename add i;
newx2 = _root._xmouse;
newy2 = _root._ymouse;
eagle.duplicateMovieClip(eaglena... 1, );but I get an error telling me that you can only apply that to a MC.
Is there a good way to do this? Other than makine a 100% w/h alpha0 MC?
thanks
- Mojo0
so basically, I need a way of detecting a mouseclick on ANYTHING.
Any ideas?
- weestu0
my AS is a bit rusty but I think you need to define a mouseDown object like:
mouseClick = new Object();
mouseClick.onMouseDown = function () {
do stuff
}
- Mojo0
Anyone?
>when mouse is clicked ANYWHERE ON STAGE
>then do something.
should be simple for someone with more AS knowledge than me?
- weestu0
?
did you even try what i said?
- UndoUndo0
I dont think it possible, but you could try Stage.onPress= function(){
}I think you need to define an object to click on...could be wrong tho
- UndoUndo0
onMouseDown is fine
- Mojo0
Tried what weestu said, doesn't appear to work.
argh
- Mojo0
do I need to define the new objects properties?
- UndoUndo0
by object I mean MC, trying laying an MC 100% width and height at the bottom of the layer stack, alpha 0
- weestu0
soz, you need to add:
Mouse.addListener(mouseClick);
to the end of the code...
- Mojo0
okay, my flashfile is not scaled however and is centered in the browser.
so how can I define the h/w of the mc with the h/w of the stage (which is 100% of browser window)?
thanks for the help guys, i really appreciate this
- UndoUndo0
good thinking weestu!
- UndoUndo0
check out weestu's suggestion that could work
- Mojo0
WEESTU I LOVE YOU
haha thanks mate! perfect! woohoo
:)
- dijitaq0
you have to have a mouse event listener.
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
//do yer thing
};Mouse.addListener(mouseListener...