Trace keycode function not to leave all the Keycodes

The function trace in this file is not out of all the codes of keys on my keyboard. Some letters generate a key code and others do not. For example, 'u' outputs 85, but the 'I' outputs nothing.

Here is the trace function...
trace (Event.keycode);

And here's the rest of the code that is a work in progress...


package {}
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.KeyboardEvent;
import flash.ui.Keyboard;

SerializableAttribute public class Velocity3D extends Sprite
{
private var ball: Ball;
private var xpos:Number = 150;
private var ypos:Number = 0;
private var zpos:Number = 150;
private var vx:Number = 0;
private var vy:Number = 0;
private var vz:Number = 0;
private var friction: Number =. 98;
private var fl:Number = 250;
private var vpX:Number = stage.stageWidth / 2;
private var vpY:Number = stage.stageHeight / 2;
private var ballb:Ball;
private var xposb:Number = 130;
private var yposb:Number = 0;
private var zposb:Number = 150;
private var vxb:Number = 0;
private var vyb:Number = 0;
private var vzb:Number = 0;

public void Velocity3D()
{
init();
}

private function init (): void
{
internship. Align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

Ball = new ball (40, 0xff0000);
ballb = new ball (40, 0xffff00);
addChild (ball);
addChild (ballb);
addEventListener (Event.ENTER_FRAME, onEnterFrame);
stage.addEventListener (KeyboardEvent.KEY_DOWN, onKeyDown);

}

private void onEnterFrame(event:Event):void
{
XPos += vx;
YPos += vy;
ZPOS += vz;

VX * = friction;
Vy * = friction;
VZ * = friction;

xposb += vx;
yposb += vy;
zposb += vz;

LIGHT * = friction;
vyb * = friction;
VZB * = friction;

If (zpos >-fl)
{
var scale: Number = fl / (fl + zpos);
ball.scaleX = ball.scaleY = scale;
ball.x = vpX + xpos * scale;
ball.y = vpY + ypos * scale;
ball. Visible = true;
}
on the other
{
ball. Visible = false;
}


If (zposb >-fl)
{
var scaleb:Number = fl / (fl + zposb);
ballb.scaleX = ballb.scaleY = scale;
ballb.x = vpX + xpos * scale;
ballb.y = vpY + ypos * scale;
ballb. Visible = true;
}
on the other
{
ball. Visible = false;
}
}

private void onKeyDown(event:KeyboardEvent):void
{
trace (Event.keycode);
Switch (Event.keycode)
{
decision 87:
Vy-= 1;
break;

case Keyboard.NUMPAD_2:
Vy += 1;
break;

case Keyboard.NUMPAD_4:
VX-= 1;
break;

case Keyboard.NUMPAD_6:
VX += 1;
break;

case Keyboard.UP:
VZ += 1;
break;

case Keyboard.DOWN:
VZ-= 1;
break;

case Keyboard.F1: //82
vyb-= 1;
break;

case Keyboard.F2: //67
vyb += 1;
break;

case Keyboard.F3: //68
LIGHT-= 1;
break;

case Keyboard.F4: //70
LIGHT += 1;
break;

case Keyboard.F5: //65
VZB += 1;
break;

case Keyboard.F6: //90
VZB-= 1;
break;

by default:
break;
}
}
}
}



-----

It's the ball class...

package {}
import flash.display.Sprite;

SerializableAttribute public class ball extends Sprite {}
public var radius: Number;
private var color: uint;
public var vx:Number = 0;
public var vy:Number = 0;
public var: mass number = 1;

public void Ball (radius: Number = 40, color: uint = 0xff0000) {}
This.RADIUS = RADIUS;
This.color = color;
init();
}
public void init (): void {}
graphics.beginFill (color);
graphics.drawCircle (0, 0, RADIUS);
graphics.endFill ();
}
}
}

you know - I have ran into this kind of thing and meditated on it for several hours - then come to discover that I needed to 'disable keyboard shortcuts' - in the command menu of the SWF file in the IDE to test running! lol - I don't know if that's your problem here, but it's worth a ;)

Tags: Adobe Animate

Similar Questions

  • I keep getting the "this connection is not approved" in all the sites when I use Firefox on windows laptop 36.0.1 8. How can I overcome this.

    I keep getting the "this connection is not approved" in all the sites when I use Firefox on windows laptop 36.0.1 8. How can I overcome this.

    Hi vijaysampath, please make sure first that the date, time, and time zone are set correctly on your system. If this does not solve the problem (or it is already set correctly), a possible solution depends on different factors:

    • What is the error code indicated under Technical Details on the error page?

    in case the error code is equal to sec_error_unknown_issuer, please try to add an exception on the bottom of the error page to verify the certificate, as shown on the attached screenshot:

    • What information about the issuer of the certificate contain?

    Please take these two pieces of information. Thank you!

  • CAPTCHA does not. have tried all the solutions support and installed the new FF. still does not. Help.

    CAPTCHA does not. have tried all the solutions support and installed the new FF. still does not. Help.

    Try creating a new profile as a test to check whether your profile is the source of the problems.

    See "basic troubleshooting: a new profile:

    There may be extensions and plugins installed by default in a new profile, so check that in "tools > Modules > Extensions & Plugins" in case there are still problems.

    If the new profile works then you can transfer files from the old profile to the new profile, but make sure not to copy corrupted files.

    See:

  • computer crashed, have windows vista, indented leave, all the documents lost, can I get all the files, how do

    computer crashed, have windows vista, indented leave, all the documents lost, can I get all the files, how to do it, in simple terms,

    Thank you.

    If by "computer of new beginning" you mean that you have started your recovery or disk restore factory set and reinstalled Windows, then the ability to recover your files is practically zero.  You can try a utility like Recuva (http://www.piriform.com/recuva) but since you have rewritten the entire hard drive, it is highly unlikely that anything will be recoverable.

  • Button to navigate to another page does not not work properly all the time.

    Hello

    I'm just starting to explore the ADF, I use Jdeveloper 12.1.3.0.0 and integrated weblogic server that comes with the IDE.

    I just created a simple application with a welcome page called Main.jsf and then 2 task bounded, streams called SearchStudentsFlow and Studenloansflow, each workflow has a jsf page. The home page has a single button that sends me to the first task flow, SearchStudentsFlow and I can see is the page in that workflow, AwardsSearch.jsf. Also in the AwardsSearch.jsf page I have a button that takes back me to the home page.

    The first problem I have is that when I run the application starting at the home page button in the works of the great homepage the first time, the button send me to the AwardsSearch.jsf , but once I decide to go back to the homepage and then click on the button to go to the first task flow the button does nothing. This happens whenever I decide to return to the home page of any page in my project.

    Also, I copied the entire previous project into a new project and I decided to use the ADF security infrastructure in this new project to create a log in page create users and give them different roles and levels of access.

    I created some users who have access to all pages and all the streams, but when I run the application starts the login page and I login successfully and go to the home page, the button on the home page does not work.


    I don't know why the button sometimes works, but not of others and also I do not know why when I use the login page, the button doesn't work. I don't know if these 2 problems are related or not.


    This is my code in the homepage:

    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html>
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
        <af:document title="Main.jsf" id="d1" binding="#{backingBeanScope.backing_Main.d1}">
            <af:form id="f1" binding="#{backingBeanScope.backing_Main.f1}">
                <af:panelGridLayout id="pgl1" binding="#{backingBeanScope.backing_Main.pgl1}">
                    <af:gridRow marginTop="5px" height="20%" id="gr1" binding="#{backingBeanScope.backing_Main.gr1}">
                        <af:gridCell marginStart="5px" width="34%" marginEnd="5px" id="gc1"
                                     binding="#{backingBeanScope.backing_Main.gc1}">
                            <af:image source="/images/NU_Logo_purple.jpg" shortDesc="Northwester University" id="i1"
                                      binding="#{backingBeanScope.backing_Main.i1}"
                                      inlineStyle="width:293px; height:197px;"/>
                        </af:gridCell>
                        <af:gridCell id="gc3" binding="#{backingBeanScope.backing_Main.gc3}" width="33%"/>
                        <af:gridCell id="gc4" binding="#{backingBeanScope.backing_Main.gc4}" width="33%"/>
                    </af:gridRow>
                    <af:gridRow id="gr3" binding="#{backingBeanScope.backing_Main.gr3}" height="10%">
                        <af:gridCell id="gc5" binding="#{backingBeanScope.backing_Main.gc5}"/>
                        <af:gridCell id="gc6" binding="#{backingBeanScope.backing_Main.gc6}">
                            <af:button text="Search Awards" id="b1" binding="#{backingBeanScope.backing_Main.b1}"
                                       action="goSearchAwards"/>
                        </af:gridCell>
                        <af:gridCell id="gc7" binding="#{backingBeanScope.backing_Main.gc7}"/>
                    </af:gridRow>
                    <af:gridRow marginTop="5px" height="70%" marginBottom="5px" id="gr2"
                                binding="#{backingBeanScope.backing_Main.gr2}">
                        <af:gridCell marginStart="5px" width="100%" marginEnd="5px" id="gc2"
                                     binding="#{backingBeanScope.backing_Main.gc2}"/>
                    </af:gridRow>
                </af:panelGridLayout>
            </af:form>
        </af:document>
        <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_Main-->
    </f:view>
    

    And this is my code in the adfc-config. XML

    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="Main">
        <page>/Main.jsf</page>
      </view>
      <task-flow-call id="SearchStudentsFlow">
        <task-flow-reference>
          <document>/WEB-INF/SearchStudentsFlow.xml</document>
          <id>SearchStudentsFlow</id>
        </task-flow-reference>
      </task-flow-call>
      <control-flow-rule id="__3">
        <from-activity-id>Main</from-activity-id>
        <control-flow-case id="__5">
          <from-outcome>goSearchAwards</from-outcome>
          <to-activity-id>SearchStudentsFlow</to-activity-id>
        </control-flow-case>
      </control-flow-rule>
      <managed-bean id="__4">
        <managed-bean-name>backing_AwardsSearch</managed-bean-name>
        <managed-bean-class>view.backing.AwardsSearch</managed-bean-class>
        <managed-bean-scope>backingBean</managed-bean-scope>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1AwardsSearch.jsf-->
      </managed-bean>
      <managed-bean id="__2">
        <managed-bean-name>backing_Main</managed-bean-name>
        <managed-bean-class>view.backing.Main</managed-bean-class>
        <managed-bean-scope>backingBean</managed-bean-scope>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1Main.jsf-->
      </managed-bean>
    </adfc-config>
    

    No idea why the button does not work correctly all the time?

    Thanks in advance

    Play well!

    Now, we understand the problem and can help you solve it.

    The problem is that you dropped the home page in the flow of student loan and place you thinking that you must return to the point of departure, the unlimited workflow. Actually, you don't the sheet flow loan student but simply see the homepage as part of the loan flow. The navigation rules remain those defined in the flow of student loan. Now, when you click on a button to jump to the stream of research, the target is undefined zed you simply stay on the same page, the home page.

    To make your work use case, you set a return action in the flow of student loan that return to the caller, the flow of research which, in turn, will return to his name the workflow without terminals that hold the homepage. Remove the homepage of flow of charge to students. The case of navigation allows to navigate between the button and the new return action.

    In the adf of flow research a wild-card rule that accesses the return operation sends the return flow to the home page. You must remove the sailing time pointing to research prices for the return operation because it can use the same rule of navigation of wild-card then. Then, you add a Bach student load flow navigation rule to the scholarship search page. This navigation is used for the return actionto_searchStudents.

    Timo

  • Artowrk album does not appear at all THE

    I got a 4G iPod, but he lost a few months ago. I know not album art has always been a problem (those missing or incorrect) and has never been fixed, but this one is new to me.

    Yesterday, I bought an iPod Touch 5, 32GB (in a store, unpublished) and updated to iOS 9.3.1 via iTunes (it came with 8.something). Everything is good.

    I start to sync my music and STILL get the error (-54). I'm familiar with it, click 'Ok' and let iTunes copy my music. Every now and then I get an error saying that the music cannot be copied because there is a lot of open files and leaves me not do something else before I close iTunes, change USB port and try again. I synced about 20 GB of music.

    I'm going on my iPod, open the new music app, reject the thing Apple music and go into my library. None of the work is here. It is not that a little (or a lot) is missing or wrong: 99.99% of the work is empty. The only to appear are those I bought directly from iTunes (and they are not much, I'm sort of a physical CD of gal) and even those who are on the trail of evil (3 covers about 20 songs bad). So I do what I know about it: restart my computer, restart the iPod, Resync, uninstall iTunes, re - install iTunes and so on. Nothing works. Before I do the crazy thing and delete all the songs I errased album, restart the computer, restart the iPod, copy of the album again. Still no work.

    Do I have to restore my iPod? It'll be a pain in the *, so I want to avoid if I can.

    Moreover, I am wrking with Windows 10.

    Thank you.

    If this does not work

    lve-problems-with-album-art-displaying/ http://www.McElhearn.com/Deleting-the-iTunes-Album-Artwork-cache-Folder-May-RESO

    Next, you will need to restore the device via iTunes

  • BlackBerry Smartphones Can I have a blackberry and not pay for all the internet services?

    Hi I'm new on this and my t-mobile phone that I broke and I looking to upgrade to something that will help me to stay a bit more organized, but are unwilling to pay for the service package that comes with the purchase of a blackberry from t-mobile. I know that I could get one on craigslist or ebay or something and I was wondering if I could just put in my Sim Card and it would have all the functions without the internet and emails. All I really want to the phone is easy navigation, good organizer, easily send SMS and calls. Thanks for the help! -Sully

    Sully, Hello and welcome to the Forums of Support BlackBerry.com.

    Sorry, no. Without the BlackBerry data Plan, you will get very little data from the device functions... voice and SMS, Yes. Calendar, contacts, etc., Yes. No RIM push email.

    You can use the Opera Mini browser for the internet with the setttings TCP active for a browser for free... just watch your billing and ensure that you are not charged.

    http://www.BlackBerryFAQ.com/index.php/What_are_the_TCP_and_APN_settings%3F

  • How to apply the Trace Bitmap function on multiple charts at the same time?

    Hi all!

    I is currently experiencing a difficult period for the application of the function of trace bitmap on multiple charts.

    It is as I have 101 graphic symbols in my library, retracing the one is so would take a lot of time, though, I created an order for the Trace Bitmap function, it takes time. While I was looking for a way to track all of them at once?

    -Thanks!

    This should do what you say you are willing to:

    var threshold = 100; // 0 - 500
    var minimumArea = 8; // 1 - 1000
    var curveFit = "normal"; // "pixels", "very tight", "tight", "normal", "smooth", "very smooth"
    var cornerThreshold = "normal"; // "many corners", "normal", "few corners"
    
    function main() {
        var i, type;
        var _dom = fl.getDocumentDOM();
        var _lib = _dom.library;
        var items = _lib.getSelectedItems();
        if (!items.length) return;
        for (i = 0; i < items.length; i++) {
            type = items[i].itemType;
            if (type == "graphic" || type == "movie clip") {
                _lib.editItem(items[i].name);
                _dom.selectAll();
                if (_dom.selection.length == 1 && _dom.selection[0].elementType == "instance" && _dom.selection[0].instanceType == "bitmap") {
                    _dom.traceBitmap(threshold, minimumArea, curveFit, cornerThreshold);
                }
            }
        }
        alert("Conversion complete!");
    }
    main();
    

    Copy and paste into a new text document and save it as tracebitmaps.jsfl. Select clips in the library to convert, then go to double click the JSFL file.

  • Integrated WLS starts does not after activating all the flags "Debug".

    Hello

    I have JDeveloper 11.1.1.4 with Integrated Weblogic Server. I had activated all "Debug" flags in the WLS and now after the bounce required servers, it does not come to the top. Should I did more than all the "Debug" options, but I am just unable to login to turn it off.

    Is it possible to get around this problem?

    Thank you

    Vikas

    Check also if you could comment on the underside of the elements in the config.xml file and restart the server, if you have not kept the backup copy of the configuration file.

    WebLogic

    true

    If the server still does not start, check the server log, for errors or critical problems and go back with the details or error stack trace to help you.

    Thank you

    Vijaya

  • ODI not to spill all the dimensions in the application

    Hi John,.

    When we tried reversed on a planning Application, I'm not able to see the scenarios, years, Versions and dimensions period under the folder of Application model. Accounts of entities and other dimensions of the UDA has spilled and I am able to load the metadata for them.

    Please let me know how to get all of the dimensions. Awaiting your response

    Thank you
    Sravan

    You won't be able to do it before the 11th, that functionality is not available.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • MagSafe adapter does not work after all the stuff that followed and merge card Ok?

    My Megasafe duck-head adapter used with a Macbook pro has stopped working while my back was turned!

    After trying all the controls and the actions described in the Apple support pages, it always dows not turn on or show any current to the small pins when checked with a multimeter.

    It is the death of the adapter or can it receive some kind of CPR?

    Chris.

    Hello!

    Could specify you which checks and actions you have done already?

    Your MacBook came with both a cable to connect to the power supply and plug adapter. Could you try both to see if it works? You might just have a broken charger.

    Please find instructions for that here: reset the management system (SCM) controller on your Mac - Apple Support

    If the battery is good behaviour

    1. Stop the Mac.
    2. Plug the MagSafe or USB - C adapter to a power source and to your Mac.
    3. Use the built-in keyboard, press shift-control-Option on the left side of the keyboard, then press the power button at the same time.
    4. All the keys to unlock, then press the power button to turn on your Mac

    If the battery is removable

    1. Stop the Mac.
    2. Unplug the MagSafe from Mac power adapter.
    3. Remove the battery. (Learn about removing the battery in the MacBook and MacBook Pro computers).
    4. Press and hold the power button for 5 seconds.
    5. Reconnect the battery and the MagSafe power adapter.
    6. Press the power button to turn on the Mac.

    Thanks for posting the results!

    -Nils

  • My search engine is not to remember all the names that I type. How can I fix this problem so that the search engine will remember that I have type.

    My search engine doesn't remember all the names that I type. What can I do to make it back as if it were?

    Yes, it's the Google site and this entry field uses autocomplete = off, Firefox won't store form data that you enter in this field of research.

    You can use the build-in on: home page as your home page that does not have this attribute.

    See for a similar case with the name and password fields.

  • my printer did not come with all the cables needed to connect to my computer

    I just got a PIXMA ip2820 and he came with all the cables needed to connect to my pc or is it wireliss and if so how I managed to connect wireless

    Hello.

    Our printers do not come with USB cables.  If you do not have a cable connected to a previous printer, you can buy any B USB standard cable locally has to establish the connection.  It is a pretty common cable located at most major retailers office supply or electronics.

    The iP2820 can only be used with a USB connection.  It doesn't have wireless capabilities.

    It has not responded to your question or problem? Find more help contact us.

  • Java does not work on all the pogo games

    How can I get java for working on all the pogo games

    Please stay with your original post on this problem. ;-)

    This post is here:
    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-gaming/Java/b09da83b-b6e9-4419-BA0F-e881f03d92fb

    and Microsoft is not yet making or supports Java or Pogo. ;-)

    There are some unanswered questions in your other post.

  • The empty folders and data LOSS and important information. don't move the files not moving OVER all THE

    I am so angry! I too moved significant LOSS of information and records in the files of vista to w7 has not transferred on :(  I'll never be able to recover all the hours of work and information, I got in there.  I have zero confidence in the safety of my data... should I go back to the paper and pen and keep books the really important stuff?

    How do you transfer the files?

    Best way to transfer files and settings from an old computer to new computer would be to use windows easy transfer.

    http://Windows.Microsoft.com/en-us/Windows7/how-does-Windows-easy-transfer-make-setting-up-a-computer-easier

    http://Windows.Microsoft.com/en-us/Windows7/products/features/Windows-easy-transfer

    http://Windows.Microsoft.com/en-us/Windows7/transfer-files-and-settings-from-another-computer

Maybe you are looking for