-
Special Member
another AS1 -AS2 quirk!!
Why won't this work with AS2???
attached code to button..
settings as2, flashplayer 7.
Code:
on (release,keyPress("<enter>"){
trace("foo");
}
It seems to work fine on AS1.. what's wrong with it on AS2?
-
No!
wow, no idea why that doesn't work, but it does respond to Shift+Enter.
-
Special Member
what? howcome? what's wit shift+enter? lemem try that..
ANYONE GOT AN ANSWER TO THIS?
Tea
-
FK's Giant
Perhaps
code: on(release, keyPress"<Enter>"){
//code
}
Maybe its case sensitive.
The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...
-
No!
Originally posted by Steve_w_V
Maybe its case sensitive.
nope, makes no difference.
@Tea_J: What I meant was, your code does not respond when hitting the enter key, but it does respond when you hit the shift key and the enter key at the same time, which is odd
-
Special Member
@yasunobu13
yeah, i knew that. it was like "what?!!!" in shock.. hehe.. it was surprising to me to see certain key combination work.. which is REALLY REALLY ODD.
People?! Got any idea's why this is? Or did the good people in macromedia forget to add these functions to AS2?
Tea
-
Special Member
c'mon guys.. im sure someone here has experienced this also..
tea
-
code:
on (release,keyPress("<enter>"){
trace("foo");
}
I didn't try this, but you're missing an end parenthesis:
code:
on (release,keyPress("<enter>")){
trace("foo");
}
Try that?
-
Senior Member
Hi,
code:
on (release, keyPress "<Enter>" ) {
// code
}
does work, either test your movie in a browser, or if you use test movie make sure you disable keyboard shortcuts (control > disable keyboard shortcuts) since in test movie the enter key is normally the shortcut for control > play. (this is the same behaviour as was found in MX)
-
Special Member
aite cool. it's working. but, if you guys dont mind me adding to this, how do we go about giving the same functionality to an MC, since Movie Clips have inherited button properties in Flash MX...
This was one reason why I got confused with the keypress issue. COz im using the button component and adding the keyPRess trigger.. Ofcourse, stoopid old me assumed that it should work like a button.
Tea
-
Special Member
ignore my previous post. I just figured out something. it might be a bug.
Try this guys..
1) First create a regular button symbol, and add a keypress "a" trigger to it that would do a trace action.. (dont use <enter> to avoid additional complications)
2) make sure it's working.. hit your keys and see if it's working..
3) now, this is the interesting part! Grab a button component from the components panel and put it on in yor movie.. u dont have to do anything.
4) now test your previous button again.
you will see that when you use a button component in your movie, you loose keyPress functionalities in your regular buttons!!! Even if you remove the Button Component from your stage, as long as it's in the library, you can say goodbye to good old KeyPress functions..
Please give me some feedback you guys.
Tea
-
Even in Flash MX, if you put two regular buttons and write each on(keyPress "a"){...};, only one is effective and the other is bye-bye ?
-
Special Member
@ericlin
im sorry mate, but you got it wrong. Please read it again.
"BUTTON COMPONENTS ARE MESSING THINGS UP "
Try even just adding a button component to your library.. not even to your stage. YOu'll see that your keypress's are not working anymore
guys, ya'll should check this issue out.
Tea
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
|