How to make an onKeyPressed function work

Hi, i have some problems with making the onkeyPressed function work. Somehow when i run it, it complains about "'static' is no longer supported. It will be removed from the language soon. Use script-level declarations for Right ". So i need to get around it. Here's the code. Make an image or replace an image with spacecraft.png.
var frame = 0;
var spaceship: ImageView;
var Spaceship = Image { url: "{__DIR__}spacecraft.png" }
var KeyX: Number = 100;
var KeyY: Number = 100;
var offsetX: Integer;          // Possible values are -1, 0 and 1
var offsetY: Integer;
var x;
var MoveLeft;
var MoveUp;
var MoveDown;
var transition: Transition;
Stage {
visible: true
title: "Spaceship"
scene: Scene {
width: 250
height: 200
content: [
ImageView {
image: Spaceship
onKeyPressed: function(e: KeyEvent): Void {
if (e.code == KeyCode.VK_RIGHT) {
Move.Right
if (e.code == KeyCode.VK_LEFT) {
var y: Number = 200;
var X: Number = 200;
// Timeline updates y variable
static class Move extends CustomNode {
var image: Image;
var transition: Transition;
var fitWidth: Number;
static var Right = Move {
image: Spaceship
translateX: 300
translateY: 100
fitWidth: 150
transition: TranslateTransition {
duration: 2s
byX: 250 repeatCount: Timeline.INDEFINITE
autoReverse: true
}

I tried the node.requestFocus(), but apparently, their is a new error when I ran it . It said "java.lang.StackOverflowError" with many at errors following it .Here our my fx codes. If you run it on your IDE, it should say the same error.
Main.Fx
Stage {
    visible: true
    title: "Spaceship"
    scene: Scene {
        width: 250
        height: 200
        content: [Move {}]
}Move.fx
var y: Number = 200;
var X: Number = 200;
var Spaceship = Image { url: "{__DIR__}spacecraft 2 png.png" }
// Timeline updates y variable
public class Move extends CustomNode {
    var image: Image;
    var transition1: Transition;
    var fitWidth: Number;
    var Right = Move {
                image: Spaceship
                translateX: 300
                translateY: 100
                fitWidth: 150
                transition1: TranslateTransition {
                    duration: 2s
                    byX: 250 repeatCount: Timeline.INDEFINITE
                    autoReverse: true
public override function create(): Node {
        //Assign Group to variable
        var myGroup = Group {
                    content: [Move.Right
                    focusTraversable: true
                    onKeyPressed: function(e: KeyEvent): Void {
                        if (e.code == KeyCode.VK_RIGHT) {
                            Move.Right;
                            transition1.play()
                    onKeyReleased: function(e: KeyEvent): Void {
                       if (e.code == KeyCode.VK_RIGHT) {
                            Move.Right;
                            transition1.pause()
                } //Group
        myGroup.requestFocus(); //This sets the focus on the group that is to be returned and put onto the stage
        return myGroup
}

Similar Messages

  • How do you make the 'places' function work in iphoto

    `i have just imported a lot of old photos from my 2007 macbook onto a new macbook pro with ilife 09. `i am trying to make the places function work but can't get it to work. The 'i' icon does not appear in the bottom right hand corner of the events main photo as it's supposed too. Any suggestions?

    Simply open an event; select 1 or more photos and select the i in the lower right corner of a photo thumbnail. You will get the Geocoding window. Start typing the address/place/country in the location area. For detailed addresses you select new place. You can resize the window. Maps from google appears and you select the place it finds. You can even drag the pin to a specific area. Press ok and your done.

  • How to make "visa find resource" working with Agilent device

    I am trying to use Agilent 82357B GPIB device with LabVIEW for instrument control.
    I have checked:
    1.       NI-VISA (ver 5.1.1) is the primary visa by checking visa.dll properties under windows\system32 folder
    2.       Enable NIVISATulip.dll in NI Max Explorer
    3.       Enable the Agilent libraries to work with NI 488.2 in Agilent IO library (ver 16).
    I am able to communicate with the instrument in Max Explorer and talk to the instrument in LabVIEW with VISA write for almost all commands.
    But I can NOT make one particular visa function (Visa find resource) working with Agilent 82357B GPIB.
    With NI USB GPIB device, the same code above can find attached instruments as below, where GPIB1 is the Agilent device and GPIB0 is the NI device.
    I have no clue on how to make “visa find resource” working with Agilent device.
    Please help.
    Solved!
    Go to Solution.

    Quick question.  Did you also enable 488 support in Agilent? 
    If that does'not work try this.  and well see if you found a bug
    Jeff

  • How to make a Button to work Actively even if there is a mandatory field..?

    Hi All..
    How to make a Button to work Actively even if there is a mandatory field to be fulfilled..???
    I am badly in need of this logic, as i have to incorporate in my code..
    Points will be rewarded without fail..

    Hi Pavan,
    I also faced the same requirement. U can do one thing like remove the obligatory keyword of that parameter/select-option. U can handle the same using the program in at selection-screen event. See this sample of code,
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:  s_land1 for T005-LAND1 <b>[Needs to be mandatory]</b>                 no intervals no-extension.
    SELECT-OPTIONS:  s_panid FOR zoindex_val-zopanid.
    SELECT-OPTIONS:  s_effdat FOR zoexchrate-zedate.
    SELECTION-SCREEN END OF BLOCK b2.
    *-- AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
      CASE sscrfields-ucomm.
    *-- Obligatory Country Code
      IF s_land1[] IS INITIAL.
        MESSAGE e050 WITH text-050.
                     "Please select the Country Code
      ENDIF.
    So whenever u do F8/Enter other than that push button, it will prompt u to enter the country code first then only u can proceed.
    Hope this would help u in some way. Please do reward the helpful answers.

  • How to make third party cables work on iphone?

    I have been using the original Apple charger cable that came with my phone (iPhone 5C) for a good year, but then it broke. So I bought this non-Apple cable because I didn't really wanna spend a lot of money for an original one. I have already charged my phone with third-party cables before, so I thought it would work. The first time I used the non-Apple cord, there were minor difficulties because I had to plug and un-plug it several times before it actually charged. 2 days later, I plugged an original cable (which was my sister's) to charge my iPhone. Obviously, it worked. But later on, when I went to charge my iPhone with the non-Apple cable, a message popped up (This accessory may not be supported). I dismissed it, thinking it would still charge. No such luck. I tried to unplug and plug it, but still, it won't charge. Now, I have to charge through my laptop. Can anyone tell me how to make third-party cables work? I don't really wanna bring my laptop everytime I charge. I'm planning to only use this cable until I get my hands on an original one. Please help.

    Are you seeing the EE (or T-Mobile) network name and network bars in the top right hand corner of the screen?  Turn off WiFi (Settings>WiFi - turn this off).  Is there anything next to the network name in the top right hand corner (3G, E or o)?  E is Edge and o = GPRS.
    If there's nothing next to the network name, turn off the iPhone and then turn it back on.  To do this, press and hold down the button on the top until you see the 'Slide to Power Off' message.  Slide and then wait for the iPhone to shut down.  To turn it back on again, press and hold the top button again unti lkthe Apple logo shows on the screen.
    EE and signal bars top left = Yes
    Turned off Wifi and next to the EE is 'o' which you say is GPRS? What does that mean please??
    Got this reply from another forum but still no success???

  • How to make material availability check work during Work Order creation

    Hi Experts,
    Kindly advice about these matters:
    1. How to make material availability check work during Work Order creation?
    My requirement is Work Order can not be created when it has missing parts. I have set the config to '3' can not created when is has missing parts, but it still does not work.
    I have implemented SAP Notes 1148139 on my system (SAP ECC 6 Ehp 5) also, but still does not have any effect.
    I must not set the config Res./Purch Doc creation to 'immediately', because it does not fit to my user requirement. Is there anyone knows how to solve this requirement?
    2. How to make information message/ Availability check screen appear when sparepart is missing, without clicking Availability Check button? for example: appear when clicking Save button.
    Thank you
    -amoonra-

    Hi Maheswaran,
    I have implement the prerequisite notes. (Notes 790219 and 1034962). Do you know why it is still does not work?
    Thanks
    -amoonra-

  • How to make the mobile application work with firewall and anti-virus ON

    Hi,
    I keep on receiving internal processing error when i try to login sap mobile solution 1.3.0 on my ipad and i was provided a solution, that is to turn off my firewall and antivirus. I works by turn off both of it but i cant possible turn of the firewall and antivirus on the server.
    Can anyone guide me how to make the mobile application work with firewall and anti-virus ON
    Thank you

    Dear Rajesh,
    Create a policy in your fire wall to allow the port to send and receive data.
    I believe the port for the mobile should be port 8080 and 8443.
    And your license server port 30000 and 30001
    nd.Q

  • How to make the Smooth Scrolling work even H Swipe is tick?

    In my article, if I tick the H Swipe only and the Smooth Scrolling is Both direction, Why is it in previewing it in my iPad the Scrolling seems Off because it's snapping into the pages.
    Smooth scrolling is not working if H Swipe only is tick.
    How to make the Smooth Scrolling work even H Swipe is tick?

    Horizontal scrolling is only for 1024x768 or 768x1024 pages. That’s it.
    You cannot combine horizontal only with smooth scrolling.
    Bob

  • GRC - Role Expert v5.2: how does the Transaction Usage functionality work

    Hi All,
    re: GRC - Role Expert v5.2: how does the Transaction Usage functionality work
    We are implementing GRC suite v5.2, but specifically my question is regarding Role Expert:
    SAP documentation states that it is possible to use Role Expert to do the following: for roles allows you to see if, or how much, a transaction is being used, when it was last used, and who used it.
    My question is how without Audit Log or RBE?
    Let me know if you have ever used this functionality and if it requires the SAP Back-End Audit Log to be turned on or RBE.
    Thanks in advance!

    Hi Gary,
    You dont need a RBE tool activation to get the successful transaction usage log with Role Expert.
    Role Expert functionality allows you to log all the transactions that have been added/deleted to the role that is changed. Also when you create a new role via the Role Expert then automatically the transaction log starts.
    If you go the "History" tab in the Role Expert, then you can find all the last changes made to the role.
    Also you can go to the "Risk Analysis" tab to find the log of Risk Analysis performed with the added tcodes.
    Hope this helps.
    Thanks,
    Kiran Kandepalli.

  • I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    I have been using Voice memos for some time but now I get a message to say No Microphone Available how do I get the function working again?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How to make Ctrl  + N function as down key in finder

    I want to make Ctrl + N function as down key and Ctrl + P function as up key in finder application for easy keyboard navigation. How can i do this?

    You're misinterpreting the way the Keyboard shortcuts you add in preferences work.
    For you to be able to turn the key sequence into a shortcut for some action that action has to exist as a menu item in the application. That is if you want to make say Show Clipboard (one menu item without a shortcut already assigned) you would put the command Show Clipboard into the section Menu Title and ad the key sequence in the Keyboard Shortcut section.
    But as there is no menu item for down one line in Finder there is nothing to put into the Menu Title section so no way to map it.
    As it turns out for text editing OS X already recognizes ^N as down one line (in fact a lot of the Emacs key bindings are recognized out of the box) Unfortunately these only apply to editing situations.  There is no way I know of to map motion commands like you are looking to do here.
    There is the possibility of adding a keybindings dictionary to your home library folder, google for something like emacs key bindings mac mavericks
    <edit> I dont't think you'll be able to do it this way either but it is worth a look</edit>
    regards

  • How to make a dynamic function call from within a package procedure

    Hi:
    I need to call a function dynamically (name and parameters determined at run time, but return value is known:always an integer). I can build the call and place it in a dynamic sql using dbms_sql. But the function is inside a package and is not public.
    So, if I issue:
    dbms_sql.parse( cur,'SELECT '||call||' FROM dual', dbms_sql.v7 )
    where call is "DOS(234,'V')"
    I get:
    ORA-00904: "DOS": invalid identifier
    If I make the function ("DOS") public and "call" equals "pack.DOS(234,'V')", it works fine, but I don't want to make it public.
    Is there a solution?
    Thanks in advance
    RuBeck

    Hi, Kamal:
    Calling from outside of the owner package is not possible if it is not public.The calls are from inside the package. It looks like the dynamic select is executed "outside" the package, so the private function is unknown
    Make it available in the package headerLooks like it's the only solution
    How often this will be executed?This is a library for loading files into tables and executing dynamic validation procedures.
    Here's an example of the mechanics:
    create or replace package mypack as
         function one return number ; -- public function
         procedure execute_it( p_name VARCHAR2 ) ;
    end ;
    create or replace package body mypack as
    function one return number is
    begin
    return 1 ;
    end ;
    function two( i number, s varchar2 ) return number is -- private function
    begin
    return 2 ;
    end ;
    procedure execute_it( p_name VARCHAR2 ) is
    select_str VARCHAR2( 1000 ) ;
    v_num NUMBER ;
    cur NUMBER ;
    nf NUMBER ;
    begin
    select_str := 'SELECT '||p_name||' FROM dual' ;
    cur := dbms_sql.open_cursor ;
    dbms_sql.parse( cur,select_str,dbms_sql.v7 ) ;
    dbms_sql.define_column( cur,1, v_num ) ;
    nf := dbms_sql.execute( cur ) ;
    IF dbms_sql.fetch_rows( cur ) = 0 THEN
    RAISE no_data_found ;
    END IF ;
    dbms_sql.column_value( cur, 1, v_numero ) ;
    dbms_output.put_line( p_name||' returns '||v_num ) ;
    dbms_sql.close_cursor( cur ) ;
    end ;
    end ;
    begin
    mypack.execute_it( 'mypack.one' ) ; -- Call public function: Works fine
    mypack.execute_it( 'two(234,''v'')' ) ; -- Call private function: error 0904
    end ;
    Thanks for your hints
    RuBeck
    PS: The indentation is lost when I post the message! I wrote it indented!

  • Why can't Apple and HP get Mountain Lion 10.8.4 to work with the HP OfficeJet 7610?  Does anyone know how to make the wireless scanning work?

    Does anyone know how to make the HP OfficeJet 7610 (latest version) and iMac 3.4 GHz i7 running 10.8.4 work together correctly?  Print function seems to work ok.  Just can't find the scanner in any setup.

    In System Preferences/Print & Scan is there a scan option?

  • How to make the default param work?

    Hi experts,
    When I define a default value for a parameter in a procedure or function, such as (p in     varchar2 default null), and when I call it without providing the parameter value, I am getting the "PLS-00306: wrong number or types of arguments in call to procname" error. How is the default supposed to work?
    Thank you.
    Ben

    Here is what I have,
    create or replace procedure CJIINGetBookingList (     
         p_LastName          in     varchar2,
         p_FirstName          in     varchar2,
         p_MiddleName          in     varchar2,     
         p_DOB               in     varchar2 default null,
         p_OLN               in     varchar2 default null,     --- DLN
         p_AddressCity          in     varchar2 default null,
         p_AddressZip          in     varchar2 default null,
         p_InCustody          in     varchar2 default null,
         p_Race               in     varchar2 default null,
         p_Gender          in     varchar2 default null,
         p_JailDateStart          in     varchar2 default null,
         p_JailDateEnd          in     varchar2 default null,
         p_ReleaseDateStart     in     varchar2 default null,
         p_ReleaseDateEnd     in     varchar2 default null,
         p_BkSearchResults     out     sys_refcursor
    Thanks.
    Ben

  • HOW TO MAKE A BOOLEAN FUNCTION IN LABVIEW5.0

    I want to use a boolean funtion but it does not exist in existing functions?so how can I do it?I final aim is how to make a VALVE boolean function and how to use it?please teach me,experts! Thank you very much!

    Hi,
    what do you mean by "boolean function"?
    For boolean operations you can use
    1. Case structure. It is located in Functions->Structures
    2. Boolean functions (such as AND, OR, NOT, etc.). They are located in Functions->Boolean
    3. Comparison functions (such as equal?, greater?, less?, etc.). They are located in Functions->Comparison
    You have to give more info about your problem.
    Good luck.
    Oleg Chutko.

Maybe you are looking for

  • Help, Itunes could not connect to the itunes store

    I has face a problem with my itunes could not connect to the itunes store. i also have check all my network but it is no problem. when i click itunes store it keep saying this. and i check my Run Diagnostics Microsoft Windows 7 x64 Business Edition (

  • BAPI for delivery VL01N transaction

    Hi All,        I am working on SAP ECC 5.0 version. My requirements are to create a delivery note against a purchase order. The purchase order is basically for Stock transfer between intra company (UB) and Inter Company (NB) . So am looking for BAPI

  • [svn:osmf:] 10859: Adding a readme file for RegionsSample.

    Revision: 10859 Author:   [email protected] Date:     2009-10-03 21:17:06 -0700 (Sat, 03 Oct 2009) Log Message: Adding a readme file for RegionsSample. Added Paths:     osmf/trunk/apps/samples/framework/RegionsSample/readme.txt

  • Problems sending via the Mail app [Lion OS X]

    I'm using the standard Mail app on my Macbook Pro with Lion OS X.  I have 3 Hotmail accounts and at one point had all of them hooked up to the Mail app and receiving e-mails fine. The problem I've had is when trying to send an e-mail or reply to one

  • XAV 601 BT - Sony feature demo

    After playing tuner, video, usb, etc., for just a minute or two, the unit stops playing selected media and drops into the Sony promo video showing the various features of the unit? Firmware is up to date. Does anyone have a solution? Solved! Go to So