sebnewyork
02-13-2005, 06:57 PM
I think what I want is very simple, yet I can't figure out how to do it:
When the user presses the SPACE bar, I want an MC to rotate 90 degrees.
But the MC is a variable (mytarget). I have a bunch of MCs, and each of them becomes "mytarget" when selected (pressed on) with the mouse.
I can't figure out how to apply
on (keyPress "<Space>")
to the variable mytarget.
Plus, it seems that
on (keyPress "<Space>")
can only be applied to a button, while it needs to be applied to an MC.
Also, I tried something like
mytarget.onKeyPress(<"Space">) = function() {
etc..
and of course it doesn't work. Well, I tried about a thousand different things.
Please help!
When the user presses the SPACE bar, I want an MC to rotate 90 degrees.
But the MC is a variable (mytarget). I have a bunch of MCs, and each of them becomes "mytarget" when selected (pressed on) with the mouse.
I can't figure out how to apply
on (keyPress "<Space>")
to the variable mytarget.
Plus, it seems that
on (keyPress "<Space>")
can only be applied to a button, while it needs to be applied to an MC.
Also, I tried something like
mytarget.onKeyPress(<"Space">) = function() {
etc..
and of course it doesn't work. Well, I tried about a thousand different things.
Please help!