Key.getCode Blues

This code is not working consisently and I can't seem to
figure it out - help? The module was built in flash 6, actionscript
1.0. I'm basically trying to make sure that a user types "x" into a
text field and presses either the control or enter key:
Does this code make logical sense? It is not working
consistently. I am basically trying to make sure some one types "x"
in either upper or lower case in a text field and presses either
enter or control.
I think I must have my operators all messed up... any help
would be greatly appreciated.
Key.removeListener(signin);
passwrd = "";
Selection.setFocus("passwrd");
passwrd.tabEnabled;
passwrd.tabIndex = 2;
puserKey = new Object();
puserKey.onKeyDown = function() {
if ((Key.getCode() == Key.ENTER) && (passwrd == "x"
|| passwrd == "X")) {
gotoAndPlay("goodjob");
if ((Key.getCode() == Key.ENTER) && !(passwrd == "x"
|| passwrd == "X")) {
gotoAndPlay("pre_useEnter");
if ((Key.getCode() == Key.CONTROL) && (passwrd == "x"
|| passwrd == "X")) {
gotoAndPlay("goodjob");
if ((Key.getCode() == Key.CONTROL) && !(passwrd ==
"x" || passwrd == "X")) {
gotoAndPlay("pre_useEnter");
if ((Key.getCode() == Key.TAB) && !(passwrd == "x" ||
passwrd == "X")) {
gotoAndPlay("pre_useEnter");
if ((Key.getCode() == Key.TAB) && !(passwrd == "x" ||
passwrd == "X")) {
gotoAndPlay("pre_useEnter");
Key.addListener(puserKey);
stop();

Can someone please make some suggestions to this - is it the
order of operation that is messed up? Should I use else if
statements? Am I using the wrong operators, a combination? Do I
need to use different brackets?

Similar Messages

  • Key.getCode() problems on PC and published .exe, .swf and .app

    Hi!
    I have a kind of unusual problem... Im building a prototype for a UI wich you can navigate around in. And we use a mockup-prototype-model with a numeric keyboard built in and connected trough USB to fetch keypresses and use that as a joystick to navigate around and get a feeling how it would feel like to navigate around using a joystick in your hands.
    The problem is that it sends kind of unusual keypresses from the joystick.
    Everything works fine when I test the movie in Flash CS5 on a mac (cmd + enter). But not on a PC or in all of the published modes (.exe, .swf or .app).
    The codes I use in my if statements to navigate that doesnt work is:
    Key.getCode() == 188, Key.getCode() == 74 and Key.getCode() == 54
    Today I use a double setup of keys so that I can use my keyboard on the computer as a backup to navigate around. And those keypresses works fine without problems. It is just those three (188, 74 and 54) that doesnt work.
    example code:
    keyListener.onKeyUp = function() {
        trace("UP -> Code: "+Key.getCode()+"\tASCII: "+Key.getAscii()+"\tKey: "+chr(Key.getAscii()));
    if((freezeActive == true && Key.getCode() == 188) || (freezeActive == true && Key.getCode() == 72)){
                        freezeNavigateLeft();
    Key.addListener(keyListener);
    I have made sure that flash has focus when ive tried this. But it is so odd that it works when I test the movie but not when I run it on a PC or in any of the published applications...
    Have any of you encountered that some keypresses doesnt work?
    Best regards
    Joel

    Think ive solved it!
    It seems like the PC recieves different signals from the input device in published mode then on the mac... so I had to trace them out in debugmode one by one and got different signals. So now it works!
    /Juhb

  • Key.getCode inconsistencies

    I am having problems with an interactive module that I
    created. It was built to work with the 6.0 player. Sometimes this
    codes works and sometimes it does not - can someone see something
    wrong with the way this is written?
    Key.removeListener(userKeynm);
    passwordz = "|";
    Selection.setFocus("passwordz");
    passwordz.tabEnabled;
    passwordz.tabIndex= 1;
    userKey = new Object();
    userKey.onKeyDown = function(){
    if (((Key.getCode() == Key.CONTROL) || (Key.getCode() ==
    Key.ENTER)) && (passwordz == "LEARNINGFS" || passwordz ==
    "learningfs")){
    gotoAndPlay("pressf2");
    } else {
    if (((Key.getCode() == Key.CONTROL) || (Key.getCode() ==
    Key.ENTER)) && !(passwordz == "LEARNINGFS" || passwordz ==
    "learningfs")){
    gotoAndPlay("wrongpass");
    if ((Key.getCode() == Key.TAB) && !(passwordz ==
    "LEARNINGFS" || passwordz == "learningfs")){
    gotoAndPlay("wrongpass");
    if ((Key.getCode() == Key.TAB) && (passwordz ==
    "LEARNINGFS" || passwordz == "learningfs")){
    gotoAndPlay("pressenter");
    Key.addListener(UserKey);
    stop();

    After playing with this -- some more -- it seems like what is
    happening is if the person types in the wrong thing and is sent
    back to say "wrongpass" - I have to have it go to the frame before
    in order to have the code process. It's like it will not
    reset/process the code unless I have a frame before the destination
    from.
    Example: frame 10 - with code: gotoandPlay ("wrongpass")
    frame 11 (code above)
    I'm wondering if I don't have the listener keys figured out
    right?? I'm putting them first in the code remove the last
    listener.

  • Satellite L500 - Can't find drivers for FN keys for Windows XP!

    Hello.
    I have found and installed all drivers I need for this laptop using Windows XP. My problem is that I can only activate Wireless on this laptop by pushin FN+F8 key, I have installed the Realtek Wireless drivers and they are installed fine, but I can't get Wireless to work because of the FN keys. When I push the FN+F8 key, a blue led should turn on next to the volume controller, but it doesn't...
    I've searched for the Hotkey Utility in the Toshiba India site, I downloaded and tryed it but I get the error "This software utility does not support this system", the Common Modules gives me the same error too.
    I've tryed installing other Hotkey Utility driver for another laptop, and it doesn't give me that error, but it doesn't work either... I actually leaves my laptop freezing a second, every 5 seconds... and the FN keys still don't work.
    Anyone know where I can find a working Hotkey Utility for my laptop using XP?
    Or maybe is there a way to activate Wireless without the FN keys? I don't need the other keys... I just want a way to activate Wireless.
    Thanks for your time

    >My problem is that I can only activate Wireless on this laptop by pushin FN+F8 key, I have installed the Realtek Wireless drivers and they are installed fine, but I can't get Wireless to work because of the FN keys. When I push the FN+F8 key, a blue led should turn on next to the volume controller, but it doesn't...
    Did you try to enable the +WLan in device manager -> WLan card -> Properties -> Advanced+ tab ?
    There are some options which control the WLan card and maybe it should be possible to enable the Wlan there.

  • Prevent Enter key from proceeding movie

    I am using this code to get the user to enter the answer 16
    in an input text field. It works but if the user hits the enterkey
    after they've gotten the question right, the playhead starts and
    moves to incorrect. This is not happening only in the testing
    environment, the published file continues when Enter is pressed.
    Can anyone help?
    keyListener = new Object();
    keyListener.onKeyUp = function() {
    if (input_txt2.text == "16" and Key.getCode() == 13) {
    //13 is key code for 'Enter'//
    gotoAndPlay("1_3_13a");
    _root.answer1 = "Correct!";
    } else if (input_txt2.text != "16" and Key.getCode() == 13)
    //13 is key code for 'Enter'//
    _root.answer1 = "Incorrect.";
    gotoAndPlay("1_3_13b");
    Key.addListener(keyListener);

    I'm not following what "…activated when the enter key
    is pressed even after the event has occurred." means. You mean that
    even after this first entry you press enter and the value of
    input_txt2.text != "16" so it is jumping to 1_3_13B?
    I think I know what you mean, maybe. Notice how you are
    setting up a listener? Well it keeps listening, it isn't a one time
    deal. It listens for a keyUp until you tell it to stop. So just
    because it works once why would you expect it to stop working? :)
    What you need to do is either inside your conditionals or
    perhaps just inside the onKeyUp function put a
    Key.removeListener(keyListener); to tell it to stop listening. If
    you are doing some kind of remediation at 1_3_13b and then want
    them to have another try, perhaps you will want to leave the
    listener or you might want to remove it and then add it back. I
    don't know the exact structure of what you are doing, but I hope
    this points you in the correct direction.

  • Life keying no longer supported by Adobe?

    I am looking for software that provides life chroma keying for a Flash based videobroadcasting. Currently an IEEE 1394 connected video source is streamed by FMLE.
    CS3 Ultra obviously had life keying capability, but it is no longer available.
    Can anybody recommend  a software, hardware or appliance that provides life keying for blue box / green box applications?

    As far as I have heard/read, there has been nothing indiicated by Adobe that Flash will no longer be supported by them in the near future.  So far there just seem to be alot of people that are misreading the articles that have come out.
    1.  Flash player has never been supported on the iStuff.  Apparently that is not going to change.  The recent articles by non-Adobe writers say that Adobe will no longer be pursuing development for the Flash player on any mobile devices.  That is supposedly just for the Flash Player, and just for mobile devices.
    2.  You should contact customer support.  I don't think they have a rent-to-own option... as far as I understand, when you rent you are kept updated on the latest versions released, so if CS6 came out tomorrow, you're already in the lineup to get upgraded to it.  The best people to ask are the ones that sell it.

  • Which is better for the keying (chroma key)..?

    for using chroma key and blue/green screen, which is better, final cut pro or final cut express. Im new with this I dont have either or am familar with either...Also, is dvMatte Pro or whatever from http://www.padd.com/dvg/prod/prod.php?prod=dvmattefcp&view=dvg a plugin for final cut? Does Final cut not already have the keying feature? Why would I need that plugin (if it is a plugin)?

    no matter what you're talking about (except price), FCP is better for everything. basically, FCE is a watered down version of FCP. the differences depend on what you want to do with it. but as far as keying, they are relatively the same. after looking at dvmattepro's site, I can't seem to figure out what it is, but the only conclusion I can come to is a plugin that saves you time keying. yes, keying will take a lot of time in FCE/FCP, and it is tricky to get right, but you don't need anything that final cut doesn't give you. check out apple's product descriptions (and numerous discussions on this forum) for details about FCE vs. FCP, or about keying.

  • How to get the key press

    Hi,
    One more question, how do you get the keypress in the main
    movie? I've tried on onClipEvent (keyDown) key.getCode etc but that
    requires to be in a movie.

    there are a couple of ways to handle this. If you are looking
    for a sepcific Key you can set up a Listener. or more like what
    your trying here, but as in:

  • "Photo Booth" Chroma key

    anyone know of a plugin in FCP that will do a "chroma key" like the way photo booth does its' chroma key effect?
    pretty much instead of keying out blue or green, photo booth asks you to step out of frame then saves the image, when you step back into frame it keys out the background the same way you could key out the color green.
    I haven't seen it, but I'm wondering if there is a way to do this in FCP.

    ok so most of my experience is w/ chroma key, so that is how I think of this. I understand that FCP takes the difference layer & thinks of it similar to a green screen. you adjust tolerance & threshold to fine tune the matte / key. I also know that there is a little bit of noise in the video (I'm shooting these tests on -6db gain to get the cleanest image) which will make the same pixel "NTSC" (never the same color frame to frame.
    but this is the best I can get it w/ my tests
    http://i30.tinypic.com/2dt3k3b.png
    http://i31.tinypic.com/2hg6b2q.png
    http://i28.tinypic.com/15eju4o.png
    this is w/ the threshold at -90 & the tolerance at 0. is this filter really this poor, because I've hit the wall in the parameters and it feels like I should have more room to move around. is this the best FCP can do? if so is there a third party app that can actually do this better?
    or are there any more tricks, like progessive vs interlace, DV vs HD, etc.
    these are some of my first attempts that were creating more of a blended key.
    http://i30.tinypic.com/k53fo2.png
    http://i26.tinypic.com/9saplg.png
    http://i31.tinypic.com/fvdxth.png

  • Chroma key effect in Premiere Elements

    If I buy Adobe Premiere Elements, am I able to use chroma key effect and receive a clean video free from green colour from the background, even around the hair? My experience is that it is not possible with cheaper programs.

    peterwallgren
    What computer operating system would you be running Premiere Elements on? If Mac, be advised that Mac does not have Chroma Key, Green Screen Key, or Blue Screen Key.
    A lot of variables in the green screen videography and photography. Best download and install Premiere Elements 13 and determine if it works for you in green screen workflow.
    Generalizing, I think it does a good job. But a generalization is not good enough when you get down to a specific setup with specific details.
    We will be watching for your follow up if you decide to look at the Premiere Elements 13 Chroma Key effect (Expert workspace, fx Effects/Keying/Chroma Key).
    ATR

  • Can Motion 5 replace a green screen and blue screen in the same shot?

    Can Motion 5 replace a green screen and blue screen in the same shot? I would like to replace a green screen with one image, and a blue screen with another.

    Fox gives a good example for keying green & blue (or any other color)  from the same shot. I'd suggest doing a few things to get better accuracy.
    First, the motion keyer always removes the color it detects the most of by default (blue/green). You can override this by setting the Strength parameter to zero, then use the Color sample tool to select the color you want. The advantage is motion will do a good job of targeting only the hue (color) that you want to remove and set an appropriate starting softness.  It also will remove spill based on this color.  Looking at Fox's example movie and the shot, I'd approach the same shot this way:
    Remove the Blue
    1. Apply the keyer and set the strength to zero.
    2. Use the Sample Color tool and select the blue (or other color) to be removed.
    3. Decrease the spill level (if needed). In Fox's example the spill from the blue glasses is going to be minimal, especially compared to the green screen, your shot may need different adjustments. Only de-spilling what you need to will give you more accurate color right away and minimize additional color correction that might be needed later.
    4. Use the Color selection tools (Chroma wheel/Luma bar) to fine tune.  Ideally you want a minimal tolerance, the inner selection, with a nice fall off, the outer selection. Try with the Scrub boxes setting first, then switch to manual if you need more control. Again see Fox's example.
    Remove Green
    It's the same as the blue, you could apply the keyed to the same clip or a parent group, at this point it's many user preference.
    With these techniques you can remove any color from a shot or create a mask based on a color. BTW, as you are learning to use the keyer I'd highly recommend  having the Color Selection open so you can see the graphs.  These give you real time feedback as you make selections and changes with the Strength, Refine and Color selection tools.  Watch what happens as you make selection or changes, sometimes the problem area is actually in the brightness not the color, or the softness may change  more than the tolerance selection.  Observing what is happening in these graphs will help you figure out wha to change and speed things up.

  • Changing the Key

    So I'm throwing together some Apple Loops in Logic to create my latest masterpiece. When searching through my media library I can simply change the key the Blue labeled audio loops play back in. But I can't for the life of me figure out how to make the change when I add it to my song.
    What am I Missing???

    Transposition is entered into the inspector

  • Enable transparent 'white areas' of my pictures that I layer above other pictures with 'keying'

    hi, i need to add a couple of pictures that have been set onto a white background. when i import them to my slide show the white background remains and i need it to be transparent so that the actual image looks like it fits nicely into the background picture. but without the background picture coming through the white parts in the center of the images im trying to import. for example, imagine a man with a white circle on his t-shirt, he is standing by a car, and this picture is on your computor white a white background, you dont want to spend hours 'cutting this image out' (painstakingly going around the car wheels etc...) so you import it as a standard rectangular shaped photo, but now its on your screen (on top of a race track picture for example) with all the extra white background around the man and car. i played with chroma key, green/blue screen, and opacity settings but cant seem to make the foreground picture (the man and car) "solid" so that the background picture cant be see through them, or through the mans white circle on his top. see what i mean??
    darren

    Darren,
    What you need to do is create an image with Transparency, in just the areas that you want Transparency. In graphic designer and photographer terms, this is a "Knockout," and is accomplished by creating a Mask in an image editing program, like Photoshop, Photoshop Elements, or the free Gimp, that worked for you in the JPEG thread. I have not seen GIMP in many, many years, so cannot tell you how to do it in that program, nor can I tell you what Tools will be available to you.
    This is how it's done in Photoshop, and GIMP should be somewhat similar - though there WILL be differences.
    With your example image, a man standing by an auto, you would make a Selection around both the man and the auto. There are many Selection Tools in PS, from the Magic Wand, to the Lasso and Magnetic Lasso. You mention the tires of the auto, and for curved shapes, I like to start with the Pen Tool, to create a Path (mathematically defined "lines" and "points," with great, smooth control). This allows me to define smooth arcs, circles, etc., and then I turn that Path into a Selection. That Selection becomes my Mask, to hold out all areas of the image. The more time spent on that Selection (whether you start with a Path, or not), the more realistic it will look.
    The Mask is used to "knockout" all background, leaving only Transparency. Now, one must Save the image to a format, that supports Transparency. Because I use Photoshop, I just the native PS format, PSD, which does support Transparency. You will be using another program, so I suggest that you use PNG-24, which also supports Transparency. Note: JPEG does NOT support Transparency, so you WILL end up with all white around the man and the auto. Your Mask will be an Alpha Channel, and you will use that to give you Transparency.
    There are tons of Selection and Masking tutorials for Photoshop, and I would suspect that some are tutorials for GIMP, as well.
    Good luck, and hope that your knockout works fine.
    Hunt

  • Newbie: Soft Key Problem

    Hey
    Environment:
    Flash Lite 2
    ActionScript 2.0
    When I run this code in the "Generic Phone" emulator, I
    several times presses on the soft keys on the emulator... But the
    words "LEFT" or "RIGHT" isn't written to the Output-window. I
    wonder what in my code are causing this problem... Below is a copy
    of my code...
    // this ActionScript sets your content to be full screen
    fscommand2("FullScreen", true);
    gotoAndStop(1);
    fscommand2("SetSoftKeys", "<<<", ">>>");
    btn_1.onPress = function() {
    gotoAndStop(5);
    btn_2.onPress = function() {
    gotoAndStop(10);
    var myListener
    bject = new Object();
    myListener.onPress = function() {
    if (Key.getCode() == ExtendedKey.SOFT1) {
    trace("LEFT");
    } else if (Key.getCode() == ExtendedKey.SOFT2) {
    trace("RIGHT");
    Key.addListener(myListener);

    Ciao
    try
    myListener.onKeyDown = function()
    instead of
    myListener.onPress = function() {
    Alessandro

  • Working with Enter Key - Reply ASAP pls

    Hi all,
    I'm working with Actionscript 2.0. I am applying the
    following code
    keyListener = new Object();
    keyListener.onKeyUp = function() {
    var keyCode = Key.getCode();
    if (keyCode == 13) {
    gotoAndPlay(1318);
    }else {
    gotoAndStop(1314);
    Key.addListener(keyListener);
    Problem I'm facing is that its not working with the enter key
    , however if i'm giving any other key code then its working. Infact
    if i'm giving the following code
    keyListener = new Object();
    keyListener.onKeyUp = function() {
    var keyCode = Key.getCode();
    if (keyCode == 13) {
    gotoAndPlay(1318);
    }else if (keyCode == 32) {
    gotoAndPlay(1318);
    }else{
    gotoAndStop(1314);
    Key.addListener(keyListener);
    Then its working fine but only in the case of else if part (
    key Code==32, space bar ), but not with the enter key.
    Please help.

    disable keyboard shortcuts if you're testing in the test
    environment.

Maybe you are looking for

  • Loops not working

    Is there a setup to enable all the loops as they dont work initially

  • Display of chinese character in AL11

    Hi, When viewing the file in application server with some chinese character the font display appears to be different.Is there any solution to avoid the different display of character when asian character appears in the application server. Regards, Ma

  • ViewMenuItem do not appear when applying custom skin on ViewNavigatorApplication

    ViewMenuItems works fine when I don't apply skinClass fo ViewNavigatorApplication, but when I apply custom skin to ViewNavigator, ViewMenuItems doesn't appear. Here is my main file <?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xm

  • User exit to set  GR field in PO while creation

    Hi All, I have requirement where we have to tick check box for GR under delivery tab in line item details of Purchase order depending on some conditions. Say, if company code is 'X' and material group is 'Y' then only this check box should get ticked

  • How can I define a new Search Node type?

    Hi experts! I'm trying to modify PPOME transaction, but I can't create a new Search Node type. Can anybody give me the necessary steps I have to do? Other question, Is it possible to create a new Search Node for a Organizational unit? Or this only co