Groups | Blog | Home
all groups > flash actionscript > may 2005 >

flash actionscript : On(key press) <up>. only aplicable to buttons?



orisma
5/15/2005 12:00:00 AM
I am trying to have the [up] key cause a miniclip to go to a specific frame, i
get this error message...

http://www.freewebs.com/orisma/girl_turn.rar

If anyone could help me or has any sugestions that would be great. thanks

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Mouse events are
permitted only for button instances
on(keyPress "<Up>"){
kglad
5/15/2005 12:00:00 AM
attach that to a movieclip or button. or use:

_root.onKeyUp=function(){
miniclip.gotoAndPlay("someFrame");
orisma
5/17/2005 12:00:00 AM
kglad
5/17/2005 12:00:00 AM
my code isn't going to work. use:

myL = new Object();
myL.onKeyDown = function() {
if (Key.isDown(Key.UP)) {
miniclip.gotoAndPlay("someFrame");
}
};
Key.addListener(myL);
orisma
5/18/2005 3:43:30 PM
its still is refusing to work... i have tryed putting the actionscript in every
possible place heres what i have got now
http://orisma.youmortals.com/girl_turn2.fla

i am complety lost as to why this wont work?
kglad
5/18/2005 6:23:45 PM
your link's not working. if that code in my most recent message doesn't work
when placed on frame 1 of your _root timeline, then it's because miniclip is
not on the _root timeline or someFrame is not in miniclip. remember, case
counts in flash.
orisma
5/19/2005 6:40:51 PM
no i cheacked that the only thing i can think of is that im using movie clips, they are the same as miniclips right?

kglad
5/19/2005 7:03:26 PM
orisma
5/19/2005 9:01:33 PM
thanks its all working now you can tack a look
http://orisma.youmortals.com/girl_turn2.swf if you like

now i am going to try and set the the y and x axis stay in line with the grid
while the charecter moves....

thanks for everyones help

orisma
kglad
5/20/2005 12:00:00 AM
AddThis Social Bookmark Button