×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    72

    Disable arrow key for scrolling in E72

    Hi everyone,

    I am new for developing flash lite in nokia, I just get problem from the start, in my game, player need to control the object by pressing arrow key, but when I press the arrow in e72(my only one testing platform), it just scroll up and down, is that possible to disable the scroll function of the arrow key and let it control by my action script again?

    Thanks for advance.

  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Disable arrow key for scrolling in E72

    By arrow keys, m sure u mean the up/down/left/right keys at the top-center of the phone. You can capture these keys by adding a key listener in ur actionscript, read here :
    KeyListener in Flash Lite
    The above example elaborates that how one can move a circle on stage by pressing the arrow keys. Moreover, you can always take a look at Flash Lite Wiki @ Forum Nokia for ready made code snippets & examples.

    Best Regards,
    SajiSoft

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    72

    Re: Disable arrow key for scrolling in E72

    in fact, is that any way to invisible the cursor on the screen? coz i added the code to control the arrow key, the cursor is still here and up and down is still use for scrolling.

    Thanks for advance.

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Disable arrow key for scrolling in E72

    Quote Originally Posted by nuthon View Post
    in fact, is that any way to invisible the cursor on the screen? coz i added the code to control the arrow key, the cursor is still here and up and down is still use for scrolling.

    Thanks for advance.
    Wait a sec . Are u running the Flash Content (SWF file) in the Browser or embedding it in the WRT ?? coz m sure there is no cursor type of thing if u run ur content in standalone Flash Lite player unless u add a cursor by urself.

    Best Regards,
    SajiSoft

  5. #5
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    72

    Re: Disable arrow key for scrolling in E72

    Quote Originally Posted by sajisoft View Post
    Wait a sec . Are u running the Flash Content (SWF file) in the Browser or embedding it in the WRT ?? coz m sure there is no cursor type of thing if u run ur content in standalone Flash Lite player unless u add a cursor by urself.

    Best Regards,
    SajiSoft
    ok, just make it clearly, here's what i have done:

    1. create a flash(mobile) file, select content type to standalone player and e72 mobile.

    2. create a movie clip call "circle", also a button with this action :

    on(keyPress "<Down>") {
    trace("Selection key pressed");
    circle._y -= 10;
    }
    on(keyPress "<Right>") {
    trace("Left softkey pressed");
    circle._x += 10;
    }
    on(keyPress "<Left>") {
    trace("Right softkey pressed");
    circle._x -= 10;
    }
    on(keyPress "<Up>") {
    circle._y += 10;
    trace("Up direction key pressed");
    }

    3. then publish the flash in flash lite 1.1.

    4. put the swf into the package, inside the package, it includes main.html, main.css, info.plist. About the main.html, i added "widget.setNavigationEnabled(false);" in the script.

    5. zip the package and change the extension to .wgz, finally send to mobile and install.

    In result, the cursor is being hidden, but it has no response when I press four arrow key, when I press the enter key which in the center, it shows the "hand" again, and seems the hand not willing to hide......

    Any steps get wrong??

    Thanks for advance.

    p.s. @ sajisoft,
    I am really appreciate for your kindly help!:-)

  6. #6
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Disable arrow key for scrolling in E72

    Now, u r very much clear. Actually, u can simply elaborate ur case by writing this "I am embedding my Flash Content in a WRT". Fitstly, u should know that the cursor is on the screen not because of the Flash Lite but it is due to the WRT.
    First Approach
    You can disable this cursor by editing the main.html :
    1- Open the main.html with notepad.
    2- Find out the javascript tag and add this "window.widget.setNavigationEnabled(false );" instead of widget.setNavigationEnabled line under it. It looks likes this than (in main.html):
    Code:
    <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">
    <!--
    
     window.widget.setNavigationEnabled(false); 
    //-->
    </SCRIPT>
    3- Now. When u run this widget on device than u have to press enter once to get the focus on the flash content.After that, u can use the arrow keys in flash content and cursor should be disabled. I tested this under N78 and it is working as expected.
    For more information, u can take a look here :
    How_to_change_Navigation_Mode_in_WRT_Widget
    Second Approach
    Try Direct Launch, it is much better than the first approach.Edit the info.plist :
    1- Open info.plist with notepad.
    2- Instead of main.html under the key MainHTML, change the string to your_main.swf (where your_main is the name of ur main swf file). It looks like this than:
    <key>MainHTML</key>
    <string>your_main.swf</string>
    This method also works fine.

    Best Regards,
    SajiSoft
    Last edited by sajisoft; 2010-05-16 at 13:31. Reason: addition

  7. #7
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    72

    Re: Disable arrow key for scrolling in E72

    still a bad new....sorry....the flash is still not work in the mobile, it still not response to any key(include "1","2"......)
    but it is normal in the simulator, no more "hand" and cursor, what's wrong by my phone?I doubt that, any player or application needs to install in the phone before I install the application i made?

    Thanks for advance.

  8. #8
    Nokia Developer Champion
    Join Date
    Jul 2008
    Location
    Pakistan
    Posts
    1,065

    Smile Re: Disable arrow key for scrolling in E72

    I doubt that, any player or application needs to install in the phone before I install the application i made?
    I dont think u have to install any thing. Flash Lite 3.0 and WRT 1.1 comes pre-installed in this phone.
    Please, make sure that u try out the second approach (written in my previous post) because it just launches swf in flash player and there are no chances of cursor anymore tested on N78.

    Best Regards,
    SajiSoft

  9. #9
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    72

    Unhappy Re: Disable arrow key for scrolling in E72

    I have tried both approach but it's still not working.
    Mouse come out and the arrow key controlling the mouse.
    When I pack the same code to E63, it works well. any one got more idea on that?
    TONS of thanks.

  10. #10
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    112

    Re: Disable arrow key for scrolling in E72

    Hi, I'm not sure I understand properly, but if you're talking about the screen scrolling up/down/left/right when you press a direction key, instead of controlling the things it is supposed to control in the game, I have experienced that on the E71.
    It may be because of having objects like MovieClips outside of the screen, even if going beyond just slightly.
    So make sure all MovieClips fit inside the screen zone entirely, and that will be fixed.

    I don't know of any way to disable the screen scroll option, I guess it's just a normal functionnality of Flash, if any MovieClip is outside the screen, even if you don't want people to see them, Flash will consider it normal to be able to see them by allowing to scroll.

    Hope that helps.

Similar Threads

  1. How to capture E72 Mute Key.
    By er.khalid in forum Symbian User Interface
    Replies: 4
    Last Post: 2010-02-18, 07:05
  2. Yucca please help: Long key press - iRepeats is never 1
    By Tasneem Rangwala in forum Symbian
    Replies: 1
    Last Post: 2009-10-28, 03:32
  3. List of Codes for Buttons
    By skela in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2008-05-20, 20:39
  4. Replies: 0
    Last Post: 2002-12-19, 07:31
  5. keybindings nokia7650 and nokia6310i
    By topisystems in forum Mobile Java General
    Replies: 1
    Last Post: 2002-06-05, 14:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×