Problems with key board events

hi, i am experiencing some key board events, in this project iam suppose to make the sphere/earth move left,right,up,down with left,right,up,down arrow.
can you please tell me if i have make any mistakes in my coding????
package
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.KeyboardEvent;
    import flash.ui.Keyboard;
    import org.papervision3d.materials.BitmapFileMaterial;
    import org.papervision3d.objects.primitives.Sphere;
    import org.papervision3d.view.BasicView;
    [SWF (width="800", height="600", backgroundColor="0x000000",frameRate="30")]
    public class InteractiveEarth extends BasicView
        private var sphere:Sphere;
        public function InteractiveEarth()
            super(800 , 600);
            var earthmaterial:BitmapFileMaterial = new BitmapFileMaterial("../assets/Earth.jpg");
            sphere = new Sphere(earthmaterial,100,20,18);
            camera.fov = 25;
            scene.addChild(sphere);
        addEventListener(Event.ENTER_FRAME,rotateSphere);
        addEventListener(KeyboardEvent.KEY_DOWN, downEarth);
       // stage.addEventListener(KeyboardEvent.KEY_UP, upEarth);
        public function rotateSphere(evt:Event):void
            sphere.yaw(0.2);
            singleRender();
        public function downEarth(event:KeyboardEvent):void
            switch(event.keyCode)
                case Keyboard.DOWN:
                    sphere.y += 5;
                    break;
                case Keyboard.UP:
                    sphere.y -= 5;
                break;
                case Keyboard.LEFT:
                sphere.x += 5;
                break;
                case Keyboard.RIGHT:
                sphere.x -= 5;
                break;

You haven't said what the problem is.
If your keyboard event handlers are not being called, perhaps you need to add the event listeners to some other object.
If this post answers your question or helps, please mark it as such. Thanks!
http://www.chikaradev.com
Adobe Flex Development and Support Services

Similar Messages

  • Problems with Key board and mouse

    Ok, right now I have my mouse connected through my keyboard. And A: My mouse scroll button won't scroll down anymore. There use to be an audible clicking when it did, and now it doesn't even make that click.
    But the annoying thing is the keyboard. Every so often (sometimes more frequently than I'd like to deal with) my keyboard goes batty and decides it's going to act like it's holding down the enter key and won't stop. It makes posting blogs and etc very difficult. because I have to spend time correcting it, at which point it starts to do it again. Has anyone else experienced this, an/or found a way to fix it?

    I have this problem occasionally.
    Sometimes something as simple as using a different USB port helps.
    best wishes
    David
    go zags

  • I have problems with syncing my events folders från MacBookAir to Ipad2. Some pictures show and not others?

    I have problems with syncing my events folders från MacBookAir to Ipad2. Some pictures show and not others?
    Anyone else having this problem?

    Try deleting the photo cache from your computer and then re-try the photo sync and see if they then copy over - the location of the cache, and how to delete it, is on this page http://support.apple.com/kb/TS1314

  • Is Anyone Else Having Problems With Key Chains After Installation?

    My installation went ok but I'm having all kinds of problems with Key Chains now that I didn't before. In addition to them being corrupted, it won't let me save corrected names and passwords even when it asks for them.

    Is there a fix if you don't have your Key Chains folder from before the 10.6 installation? I keep having to re-type my MobileMe and student Gmail passwords in Mail, and if I check remember password in Key Chain, I keep having to re-type the password until I uncheck the box, but then that means I have re-type the password every time I send an email or put the computer to sleep.
    Also, Keychain Access's First Aid shows that there are no problems whatsoever. When I click on MobileMe in my System Preferences I get 8 or so consecutive errors stating "Keychain Error. There was a problem saving to your keychain. Try again or use Keychain Access to verify your keychain." When I look at my login within Keychain Access, it says my MobileMe keychain is restricted (even after entering my administrator password).

  • Problem with key Server in GETVPN

    I had a problem with my key servers in GETVPN, I could not understand well so far. My two key servers had problems with being a key issue of inspiration and had other physical problems. I have configured the OPEN and CLOSED in my understanding communication between GM should continue with the same problem with key servers, but went more than 24 hours and ended up falling all GETVPN network. My question is as follows: after the fall of the keys, primary and secondary servers in more than 24 hours while the TEK keys no longer work and the whole network goes down and it even?
    Eduardo Severo
    [email protected]

    Those fields should be on top of the view's field list. Also, the join conditions must be complete, e.g. also include MANDT, as far as I know.
    The system defines all view fields as key fields, if it cannot otherwise determine a unique key based on the join conditions and the primary keys of the joined tables.
    If that's not it, I have no further idea.
    Thomas

  • For everyone having memory problems with this board

    I have been working on my memory problems with this board. Memtest failed every pass yet memory was fine and board was fine. Was using Kingstone Value Ram
    Set bios version back to 1.7
    set preformance to fast
    set memory to
    2.5
    4
    4
    8
    Set voltage to 2.7 if that does not work go to 2.75
    now working great no more blue screens or os getting corupt it seems to run like a charm
    Thanks to the people who have posted sefull iformation even know you have to dig deep to find it.

    i was having mem problems with this board. But i set up bios v2.2 - ram voltage 2.75 - performance mode: slow and ram timing by SPD.
    Seems to work great for me but my video card is messed up so my comp dies every ones in a while.  

  • Problem with MSI Board and MSI Geforce 4 with Windows XP

    I have a MSI 845E Max(MS-6566E)
                  MSI Geforce 4 - 420
                  Celeron 1.7 gig
                  Soundblaster Live
                  2 Network Cards
                  and the usual stuff.
    I have loaded Windows 98 on my system and it works fine. But then I load Windows XP on and the system starts rebooting. After it reboots my video resets itself and I have to load it back in. I will then reboot and sometimes it will work, sometimes it will not. I try playing a game or even searching the net for awhile, but out of the blue the system will give a very quick blue screen and reboot. And of course when it boots up the video is reset. I loaded all the drivers I could find on MSI's website and used every video driver made by Nvidia and MSI. If I do a Windows XP update to my system the computer will not even boot up. it will just keep rebooting when it is trying to bring up the login screen.  Anyone else run into this with Windows XP?

    My system sometime freezes. Why ???
    P4 1.8A GHz Notrtwood, 256MB PC2700, MSI Geforce 4 TI4400, SB Live 1024
    Check my logs:
    1)
    // Watchdog Event Log File
    LogType: Watchdog
    Created: 2002-07-23 20:03:27
    TimeZone: -60 - Central Europe Standard Time
    WindowsVersion: XP
    EventType: 0xEA - Thread Stuck in Device Driver
    // The driver for the display device got stuck in an infinite loop. This
    // usually indicates a problem with the device itself or with the device
    // driver programming the hardware incorrectly. Please check with your
    // display device vendor for any driver updates.
    ShutdownCount: 108
    Shutdown: 0
    EventFlag: 1
    EventCount: 1
    BreakCount: 1
    BugcheckTriggered: 1
    DebuggerNotPresent: 1
    DriverName: nv4_disp
    DeviceClass: Display
    DeviceDescription: NVIDIA GeForce4 Ti 4400
    HardwareID: PCIVEN_10DE&DEV_0251&SUBSYS_87111462&REV_A3
    Manufacturer: NVIDIA
    DriverFixedFileInfo: FEEF04BD 00010000 0006000D 000A0BD6 0006000D 000A0BD6 0000003F 00000008 00040004 00000003 00000004 00000000 00000000
    DriverCompanyName: NVIDIA Corporation
    DriverFileDescription: NVIDIA Compatible Windows 2000 Display driver, Version 30.30
    DriverFileVersion: 6.13.10.3030
    DriverInternalName: nv_disp.dll
    DriverLegalCopyright: (c) NVIDIA Corporation. All rights reserved.
    DriverOriginalFilename: nv_disp.dll
    DriverProductName: NVIDIA Compatible Windows 2000 Display driver, Version 30.30
    DriverProductVersion: 6.13.10.3030
    2)
    // Watchdog Event Log File
    LogType: Watchdog
    Created: 2002-08-12 18:53:23
    TimeZone: -60 - Central Europe Standard Time
    WindowsVersion: XP
    EventType: 0xEA - Thread Stuck in Device Driver
    // The driver for the display device got stuck in an infinite loop. This
    // usually indicates a problem with the device itself or with the device
    // driver programming the hardware incorrectly. Please check with your
    // display device vendor for any driver updates.
    ShutdownCount: 235
    Shutdown: 0
    EventCount: 8
    BreakCount: 8
    BugcheckTriggered: 1
    DebuggerNotPresent: 1
    DriverName: nv4_disp
    EventFlag: 1
    DeviceClass: Display
    DeviceDescription: NVIDIA GeForce4 Ti 4400
    HardwareID: PCIVEN_10DE&DEV_0251&SUBSYS_87111462&REV_A3
    Manufacturer: NVIDIA
    DriverFixedFileInfo: FEEF04BD 00010000 0006000D 000A0C0A 0006000D 000A0C0A 0000003F 00000008 00040004 00000003 00000004 00000000 00000000
    DriverCompanyName: NVIDIA Corporation
    DriverFileDescription: NVIDIA Compatible Windows 2000 Display driver, Version 30.82
    DriverFileVersion: 6.13.10.3082
    DriverInternalName: nv_disp.dll
    DriverLegalCopyright: (c) NVIDIA Corporation. All rights reserved.
    DriverOriginalFilename: nv_disp.dll
    DriverProductName: NVIDIA Compatible Windows 2000 Display driver, Version 30.82
    DriverProductVersion: 6.13.10.3082
    3)
    // Watchdog Event Log File
    LogType: Watchdog
    Created: 2002-09-07 22:22:41
    TimeZone: -60 - Central Europe Standard Time
    WindowsVersion: XP
    EventType: 0xEA - Thread Stuck in Device Driver
    // The driver for the display device got stuck in an infinite loop. This
    // usually indicates a problem with the device itself or with the device
    // driver programming the hardware incorrectly. Please check with your
    // display device vendor for any driver updates.
    ShutdownCount: 408
    Shutdown: 0
    EventCount: 14
    BreakCount: 14
    BugcheckTriggered: 1
    DebuggerNotPresent: 1
    DriverName: nv4_disp
    EventFlag: 1
    DeviceClass: Display
    DeviceDescription: NVIDIA GeForce4 Ti 4400
    HardwareID: PCIVEN_10DE&DEV_0251&SUBSYS_87111462&REV_A3
    Manufacturer: NVIDIA
    DriverFixedFileInfo: FEEF04BD 00010000 0006000D 000A0FC9 0006000D 000A0FC9 0000003F 00000008 00040004 00000003 00000004 00000000 00000000
    DriverCompanyName: NVIDIA Corporation
    DriverFileDescription: NVIDIA Compatible Windows 2000 Display driver, Version 40.41
    DriverFileVersion: 6.13.10.4041
    DriverInternalName: nv_disp.dll
    DriverLegalCopyright: (C) NVIDIA Corporation. All rights reserved.
    DriverOriginalFilename: nv_disp.dll
    DriverProductName: NVIDIA Compatible Windows 2000 Display driver, Version 40.41
    DriverProductVersion: 6.13.10.4041

  • Problem with checkbox and Event.stop(event)

    Hello,
    I cannot change the checkbox in a row, if the Event.stop(event) is fired on checkbox. My aim is, that the event OnRowClick is stoped, if I change the checkbox in the row.
    <rich:extendedDataTable id="requestTable" value="#{requestListHandler.normalisedRawRequestList}" var="req"
                             rows="#{requestListHandler.limitRows}" selectionMode="single">
                             <a4j:support event="onRowClick" action="#{requestListHandler.viewRequest}">
                                  <f:setPropertyActionListener value="#{req}"
                                       target="#{requestHandler.selectedRequest}" />
                                  </a4j:support>
                            <rich:column>
                                       <h:outputText value="#{req.offerListSize}">
                                            <f:convertNumber type="number" />
                                       </h:outputText>
                         </rich:column>
                             <rich:column id="checkBoxColumns">
                                       <h:selectBooleanCheckbox onclick="Event.stop(event);"
                                            value="#{req.firstInterpreterTimeChecked}"/>
                         </rich:column>
    </rich:extendedDataTable>I know I am using richfaces, but I have problem with sun-ri component <h:selectBooleanCheckbox..../>.
    Have you any idea?
    Manu
    Edited by: Argonist on Jun 16, 2009 8:27 AM
    Edited by: Argonist on Jun 16, 2009 12:25 PM

    I had the same problem. I read you post and was so disappointed that no one had answered you. But I have a good news for you :) My team leader managed to solve this awkward problem.Add to h:selectBooleanCheckbox style="z-index: 20;" so that it is "above" the table row that fires its own onclick event.

  • MacBook Pro 15 with Windows 8.1 installed via Boot Camp problem with keys "@" and " " of the keyboard

    Hello,
    I have a MacBook Pro Retina Maverick in 2013 on which I installed Windows via Boot Camp 8.1.
    The installation went well but when I am running Windows 8.1, I have a problem with "@" and "<" keys on the keyboard.
    When I type the "@" key, I get "<"
    When I type the "<" button, I get "@"
    I have reinstall Boot Camp from Windows 8.1 for reinstall the drivers and see if it would solve the problem but it was not the case.
    Someone of you has he encountered the same problem?
    Thank you.

    The language of my Keyboard is French

  • Hi everyone. I have just started having problems with iCal.  Events that I thought I had deleted are appearing on Print Preview and on print outs. Likewise Events which I have not deleted have disappeared from my calenders, but appear in print preview.

    Hi everybody. I have recently started having problems with iCal (Version 2.05 (1069). Events that I thought I had deleted appear in Print Preview and Print Outs. Likewise Events that I have not deleted have disappeared from my calender (Month View) but appear in Print Preview and Print Outs. I see that there have been similar problems with Events disappearing especially in Month View. I wondered how print preview seemrd to be picking everything up deleted or not, and what the solution may be?. First time of Posting. I hope I haven't embarassed myself.

    Hmmmm.
    At the very least there must be a "com.apple.ical.plist"...iCal would not function without it.
    Click on the Finder icon in the dock
    Click on Go > Home
    Double-click Library
    Double-click Preferences
    Look for a file called "com.apple.ical.plist" and remove it to the trash.

  • Having problems with key chain password

    I just got my mac book yesterday, and I'm having problems with my keychain password.
    My keychain password is not the same as my login password, it won't accept it, so i think i made a typing error.
    Each time i go on to safari, it asks for the password, which i don't have. i've tried the key chain first aid, and that still doesn't work. I've also tried keychain access, and that also doesn't work as it asks for the password first!
    Is there a way that i can reset it?

    There are user passwords and Administrator passwords. The only way to check your keychain password is to be the administrator. In an effort to secure my MacBook, I have an administrator account that I don't use at all and I have a user account that is all I use. It is a great way to protect your MacBook info from others.
    As to your question, passwords are case sensitive. You can try to change the password by inserting the CD's that came with your MacBook and reset the password. Seeing that you just got it yesterday, you probably don't have much personal information on it yet, you could use disk utility from the CD and reinstall the Operating System.
    Good Luck.
    Adam

  • Problem with MOUSE OUT event in complex MCs

    Hi,
    I've got a problem with detecting mouse out event (AC3)
    appearing when MC
    contains other embeded MCs. The Event.MOUSE_OUT seems to be
    unusefull
    because every MC attached to parent triggers this event. I
    can't turn off
    mouse listening for these objects because they are a kind of
    buttons
    (thumbnails in picture gallery). So MOUSE_OUT event is
    triggered even when
    we are still inside parent MC. More over - MC has irregular
    shape which
    makes impossible to check mouse position and compare it 'by
    hand' with
    object with not rectangular boundary. Does anybody know how
    to solve this
    issue ?
    Regards,
    Marek

    > yes this is expected behaviour with MOUSE_OUT, which is
    why there is
    > another
    > event ROLL_OUT, which as Flash help says, "...is to
    simplify the coding of
    > rollover behaviors for display object containers with
    children."
    Thanks a lot Craig !
    Now it works fine.

  • KVM switchs, any problems with MSI boards???

    Hi Everybody!!
    X-Abit fan here, I have a 2 port Belkin DVI KVM switch. I had trouble with Asus and kvm's so I'm asking ahead of time. I built a couple of MSI boxes in the P3 days and had good experience. I'm glad to here Quality is back as a priority at MSI. Congrats on the #1 spot on Tomshardware 965P round up.
    Hope the forums here as lively as the Abit one is.
    Thanks for the help??   

    some KVM switch has incompatibility issue with some boards. What you have is just by luck they both work together!

  • Problem in capturing key board event

    Hi
    I am trying chart selection using keyboard.I tried same
    example given in "
    http://livedocs.adobe.com/flex/3/datavis_flex3.pdf"
    code is
    <?xml version="1.0" ?>
    <!-- charts/SelectAllItems.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    creationComplete="initApp()">
    <mx:Script>
    <![CDATA[
    import mx.collections.ArrayCollection;
    import flash.events.KeyboardEvent;
    import mx.charts.events.ChartItemEvent;
    [Bindable]
    private var expensesAC:ArrayCollection = new ArrayCollection(
    { Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 450 },
    { Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
    { Month: "Mar", Profit: 1500, Expenses: 500, Amount: 300 },
    { Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 900 },
    { Month: "May", Profit: 2400, Expenses: 575, Amount: 500 }
    private function initApp():void {
    application.addEventListener(KeyboardEvent.KEY_UP,
    keyHandler);
    private function keyHandler(event:KeyboardEvent):void {
    var ctrlPressed:Boolean = event.ctrlKey;
    // If the user presses Ctrl + A, select all chart items.
    if (ctrlPressed) {
    var curKeyCode:int = event.keyCode;
    if (curKeyCode == 65) { // 65 is the keycode value for 'a'
    selectItems();
    private function selectItems():void {
    // Create an array of all the chart's series.
    var allSeries:Array = myChart.series;
    // Iterate over each series.
    for (var i:int=0; i<allSeries.length; i++) {
    var selectedData:Array = [];
    // Iterate over the number of items in the series.
    for (var j:int=0; j<expensesAC.length; j++) {
    selectedData.push(j);
    // Use the series' selectedIndices property to select all the
    // chart items.
    allSeries
    .selectedIndices = selectedData;
    ]]>
    </mx:Script>
    <mx:Panel height="100%" width="100%">
    <mx:PlotChart id="myChart"
    height="207"
    width="350"
    showDataTips="true"
    dataProvider="{expensesAC}"
    selectionMode="multiple"
    >
    <mx:series>
    <mx:PlotSeries id="series1"
    xField="Expenses"
    yField="Profit"
    displayName="Expenses/Profit"
    selectable="true"
    />
    <mx:PlotSeries id="series2"
    xField="Amount"
    yField="Expenses"
    displayName="Amount/Expenses"
    selectable="true"
    />
    <mx:PlotSeries id="series3"
    xField="Profit"
    yField="Amount"
    displayName="Profit/Amount"
    selectable="true"
    />
    </mx:series>
    </mx:PlotChart>
    <mx:Legend dataProvider="{myChart}" width="200"/>
    </mx:Panel>
    </mx:Application>
    This example won't work. nothing happen after pressing ctrl
    +A .
    can any body help me in that?
    Thanks
    sm

    This line of your code:
    allSeries.selectedIndices = selectedData;
    should be this (that's what in the PDF):
    allSeries.selectedIndices = selectedData;
    Ya gotta copy the sample code correctly...
    Also, nothing will happen from the keyboard until you click
    somewhere on the chart.

  • Problem with Logic Board in a Macbook Pro 15" 2011 in Argentina

    Hi I am from Argentina and I am reporting a problem I've had a few weeks ago:
    I was working with my computer (MacBook Pro 15 inch Late 2011) and it suddenly stopped working; the screen was frozen. I proceeded to restart it, but it couldn't enter the operative system, showing a gray screen.
    Given this huge problem, I took my MacBook Pro to an authorized support centre in my country (Mac Station, 1184 Ayacucho , Buenos Aires - Argentina). The people there told me that the Logic Board was damaged. For this reason they set a budget of 2.440 dollars for the replacement part – plus the installation cost of 120 dollars. They were trying to charge me the equivalent to a new MacBook Pro model MGXC2LL/A purchased in the USA.
    On the web it is documented that the 2011 MacBook Pro has recurrent failures on the Logic Board. How can it be that the total cost of repair in my country is five times the cost of repairing it in the United States? I think their official resellers in Argentina are taking advantage of us.
    How I can get in touch with Apple support or someone who can give me a reason for that cost? Can I recieve official Apple answer in this comunity?
    In advance: I haven't got Apple Care because Official Reseller from Argentina said me that Apple had discontinued in South America.
    Maria Emilia
    Buenos Aires, Argentina

    Thanks muchly will check it out now.

Maybe you are looking for

  • Using one user account table across multiple databases but account used as a foreign key

    I want to use one user account table from one database and use it across a couple other databases. The problem is that I want some tables to use the primary key from the user account table as a foreign key to access the data when the user logs in. Is

  • ITunes 10.5 crashes on opening

    As of yesterday, my iTunes (updated to 10.5) crashes on opening... I believe the only thing that has changed is that I installed Retrospect 9.0 (backup software) at or near the same time. Looks like library not loading... any ideas on how can I fix?!

  • Missing Panasonic Lumix DMC-GF1 is a bug and you must help! Workaround!

    I've found out that Apple does a simple string check inside the RAW files and doesn't support the Lumix DMC-GF1, because it simply doesn't check for the name. If you open a RAW file from the DMC-GF1 you will immediately see the text PanasonicDMC-GF1

  • SAP MII Component Hierarchy : Customer Support System

    The SAP MII component hierachy in the SAP Customer Support System has been changed.  MII components will be listed under MFG (SAP Manufacturing) on November 22, 2008, instead of the previous XAP-MII component.  As of this date, all NEW messages can o

  • How do I right-click???

    That really bugs me. Is it impossible or something???