Using keystokes rather than mouse

Hey folks,
I'm a bit of a novice at this lingo so if anyone can help
out there it'd be much appreciated. I'm creating a sliding tile
puzzle game, and the lingo that is operational allows the tiles to
move on mouse clicks. However I want to alter the code so that the
individual tiles (Sprites 1-9) move on their relevant keys i.e.
1-9. I'm using sendAllSprites to move the tiles on the mouse but
I'm stuck with the keystroke command. I guess I'm supposed to put
individual code on each of the sprites with the relevant
'keystroke' command????

Hi,
There are a few different ways you can do it:
1. Check for #keyDown events
2. Check, on every #exitframe, what keys are currently
pressed using KeyPressed()
3. Use the 'keyDownScript'
To respond to Keydown events, you need to remember that
#keyDown events are only sent to certain sprite types (editable
text etc). If your tiles are bitmaps, they probably wont receive
#keyDown. In this case, using a frame script like this might help
on keyDown (me)
k = the key
case(k) of
"1": doSomething()
etc
end case
end
With the second approach, you would add a behaviour like this
onto each of the individual tile sprites:
on exitframe (me)
if keyPressed(thekeythatIamInterestedIn) then
doStuff()
end if
end
With the third approach, you would do something like this
on startMovie
the keyDownScript = "MyKeyControlScript"
end
on MyKeyControlScript ()
k = the key
case(k) of
"1": doSomething()
etc
end case
end
- Luke

Similar Messages

  • [svn:fx-3.x] 9493: Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects .

    Revision: 9493
    Author:   [email protected]
    Date:     2009-08-23 16:09:56 -0700 (Sun, 23 Aug 2009)
    Log Message:
    Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects.
    QE notes:  None
    Doc notes: None
    Bugs: SDK-13919
    Reviewer: N/A
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22435
        http://bugs.adobe.com/jira/browse/SDK-13919
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/utils/ObjectUtil.as

  • Why won't Compressor let me submit? And why use compressor rather than FCP?

    Hey I'm using Compressor with Final Cut Hd and a Powermac g5.
    So from Final Cut I've gone to 'Export' using 'Using Compressor', for a piece of Quicktime that I want to convert to Mpeg 4. IN compressor, I've set a MPEG 4 conversion, and I've set a destination. But the 'submit' button hasn't come on, and I can't go ahead with the operation. Can anyone tell me the basic things that would prevent me going ahead with the conversion here - no matter how obvious? I'm a new user, and I don't know what I'm doing wrong... any hints?
    Secondly, why do I need to use compressor for this - what's the advantage of using Compressor rather than using the QTconversion panel export from Final Cut Pro?
    Thanks for your help with these issues - you guys rock!
    Best
    Richard

    You may not have enough free hard drive spacein your destination folder or your destination folder is Write protected. I've had that problem and compressor will not always tell you why its not giving you the ok to submit yu kind of have to figure it out. *** far as the benifit of useing it the only rel one is that you can continue to use final cut to do other work while compressor is working, ut that only works if you first export it as a fcp Quick time move and then open compressor and drag and drop the fcp full dv or hdv quick time movie into compressor for compression. affter that you can quite compressor without even saving it and it will continue to work in the background only using what ever cpu power you aren't using allowing you to continue to work on other parts or projects.

  • [svn:fx-trunk] 5061: Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance .

    Revision: 5061
    Author: [email protected]
    Date: 2009-02-24 14:18:51 -0800 (Tue, 24 Feb 2009)
    Log Message:
    Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance. By doing this we save the overhead of calling describeType() and doing RTTI. Also updated the backgroundColor to be cast to uint until the getter/setter is updated to return that (currently it is object)
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Ryan F & Glenn
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxApplicationSkin.mxml

    Revision: 5061
    Author: [email protected]
    Date: 2009-02-24 14:18:51 -0800 (Tue, 24 Feb 2009)
    Log Message:
    Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance. By doing this we save the overhead of calling describeType() and doing RTTI. Also updated the backgroundColor to be cast to uint until the getter/setter is updated to return that (currently it is object)
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Ryan F & Glenn
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxApplicationSkin.mxml

  • [svn:osmf:] 14927: Refactor sample to use MediaPlayer rather than traits.

    Revision: 14927
    Revision: 14927
    Author:   [email protected]
    Date:     2010-03-22 17:12:29 -0700 (Mon, 22 Mar 2010)
    Log Message:
    Refactor sample to use MediaPlayer rather than traits.  Fix typo in another example.
    Modified Paths:
        osmf/trunk/apps/samples/framework/DynamicStreamingSample/src/DynamicStreamingSample.mxml
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/traceproxy/TraceListene rProxyElement.as

  • Can I use thumbnails rather than the {sitename} to load different galleries?

    Hi all-
    I'm new to Spry and all things Javascripting but I'm attempting to construct a image gallery using Spry in Dreamweaver CS3. I've used the "Original Photo Gallery" from the Spry Demo folder as a jumping off point and everything works correctly.
    I would like to know if it is possible to use representative thumbnails rather than the select dropdown to launch the different galleries? I'm sure it is, but I'm a total neophyte and have no idea what to do. I'd like to set up a AP Div with 9 thumbnails in a table that would each launch a different gallery. How do I do that?
    Jimmy

    Hello, because you're SELECTing tournament.tourtype in the SELECT list, the answer is not really. If you didn't need t.tourtype in the SELECT list, you could have:
    select m.memberid, m.lastname, m.firstname
    from member m
    where exists (select 1
            from entry e inner join tournament t on (e.tourid=t.tourid)
            where m.memberid=e.memberid
                and upper(t.tourtype)='OPEN');And you know the t.tourtype is 'OPEN' anyway, so you don't need to SELECT it. So you could have this, and the answer is yes:
    select m.memberid, m.lastname, m.firstname, 'OPEN' tourtype
    from member m
    where exists (select 1
            from entry e inner join tournament t on (e.tourid=t.tourid)
            where m.memberid=e.memberid
                and upper(t.tourtype)='OPEN');Edited by: SeánMacGC on May 7, 2009 2:09 AM

  • Why should i use JSF rather than Struts?

    What makes JSF useful than Struts? In my project I am using like
    <h:commandButton action="#{loginbean.execute}" actionListener="#{loginbean.handleEvent}" ..../>
    In the above commandButton as you can see that i am not exposing the beanName. However i am exposing the beanMethod which are execute and handleEvent. Is there any other way to hide the name of the method because
    From what i understand is Presentation Layer should be shielded from whatever is going on in the backend. So, this doesn't do good right?
    Please suggest.
    How does Component and Renderers help. I am using encodeEnd() method in Renderer to render what the input or the output should look like. Do we need to switch to JSF from Struts just because of this... I don't see how and why components and renderers could help me..

    srikanthradix wrote:
    What makes JSF useful than Struts? In my project I am using like
    <h:commandButton action="#{loginbean.execute}" actionListener="#{loginbean.handleEvent}" ..../>
    In the above commandButton as you can see that i am not exposing the beanName. However i am exposing the beanMethod which are execute and handleEvent. Is there any other way to hide the name of the method because
    From what i understand is Presentation Layer should be shielded from whatever is going on in the backend.You can use "binding" and define everything in Java code if you want. You can rename your method to reflect what you want to see in the front end if you want. You can use JSFTemplating to use handlers which can be mapped to any name you want to see and do not have to match the method name of the java class (although I suspect this is the opposite direction from what you are suggesting you want).
    EL in jsf (i.e. #{bean.login}) is meant to do the mapping in JSF pages rather than externalize this in a separate file and force the page developer to edit multiple files for simple tasks. Although in some cases navigation is broken out into a separate file (i.e. faces-config.xml file using the default NavigationHandler navigation rules), this can also be done inline. It's a different way of doing development and has its pros and cons (easier, but mixes up presentation and controller somewhat). That said... JSF is very flexible, it CAN externalize any of this information, it just requires you to provide a different ViewHandler information that allows you to enter the data the way you like to see it (imo, you won't realize any benefit from the separation, though -- I used to think it was worth doing but have changed my opinion).
    So, this doesn't do good right?Perhaps in theory... but in practice, I don't think it really has a drawback. One caveat, I like how I implemented event handling in JSFTemplating as opposed to action/actionListener attributes which are not configurable and are more opaque than I prefer. My parameterized handlers allow for better code-reuse, but arguably mix up presentation and controller code even more (depending on how they're used).
    Please suggest.
    How does Component and Renderers help. I am using encodeEnd() method in Renderer to render what the input or the output should look like. Do we need to switch to JSF from Struts just because of this... I don't see how and why components and renderers could help me..The idea of a component helps tremendously as someone else can create a component for you and you can benefit from it. There are many great component sets available on the market (for free and for purchase). For example: Woodstock (which has drag/drop support inside NetBeans), RichFaces, IceFaces, Tomahawk, Scales, etc.
    Renderers allow you to cleanly separate the presentation of a component with the data of the component. You can then switch out the presentation to support multiple markups (i.e. client devices). In addition, JSF's rich lifecycle provide logical places for certain types of operations to occur, the renderers participate in this so that they are performing their tasks at a well defined time. And finally, many different components may re-use the same renderer, or a single component may use one of several renderers. The separation of data and display (model and view) makes this very clean.
    JSF is not Struts. If you expect it to be struts, you may be disappointed (or if you expect struts to be JSF, you'll be disappointed). JSF has a lot to offer (as does struts), you have to decide what is important to you and your organization. Some things to consider wrt to JSF: very strong vendor support; many large set of components to choose from; multiple standards-based tools to choose from; very flexible (most parts of the framework are pluggable); active growing development community; component-based model which encapsulates complexity for things like Ajax, pagination, and other things (often complicated in a non-component architecture); good integration with other frameworks.
    I don't know if this makes your decision any easier, but hopefully it helps clarify how you should be viewing JSF & Struts.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • How do I change the examples to use Oracle rather than Cloudscape

    I set up the JDBC connector and can ping my Oracle DB from WebLogic. I know what
    to run the first EJB example using the Entity beans and persisting with the CMP.
    I built a table in Oracle - just don't know the process for talking to Oracle
    rather than to Cloudscape which seems to start automatically with the Examples
    server. I have the JDBC code, but where do I put it? What config files need to
    be modified?
    Thanks!

    rcolbroth wrote:
    Is there anyway of creatiing a different name for this Folder rather than 2013?
    If you are using one of Lightroom's "date-based" folder templates, then the folders are created in accordance with the image capture date, not the date that you happen to import it. If you specifically want to use the import date for your folder names then you probably don't want to use the Lightroom date template, and instead you'll need to setup your folder names manually.
    The vast majority of users that use date-based folder naming schemes will use a standard Lightroom template, i.e. based on the much more meaningful image capture date.

  • How can I get iTunes to use voucher rather than credit card when downloading to iPod touch?

    How can I set up an iPod touch so that it uses iTunes vouchers when downloading apps etc rather than charging to a credit card?

    Hello, Helen. 
    Thank you for visiting Apple Support Communities. 
    Here is the best resource on how iTunes Store purchase are billed. 
    iTunes Store: How iTunes Store purchases are billed
    http://support.apple.com/kb/HT5582
    Regards,
    Jason H. 

  • Why use JPDK rather than Pl/SQL PDK

    Hi All,
    currently I have deployed all my portlets using the Pl/SQL PDK which is very good, but slow to create portlets in that it takes time to create each portlet.
    what are the advans / disadvans to using the Java PDK to create portlets ?
    I perfer to wqork at the PDK level rather than the portal application level as I have found the PDK portlets much more portable / scalable when installoing on different servers.
    Any information on the JPDK would be very helpful.
    thanks Darragh

    Hello,
    Thanks for your answer, it's very helpful. I'm still looking for a strategy to link the VO and the EO though. I thought about registering the EO in the VO as normally, but not use it in the query (obviously) then override the ViewRow and do some funky stuff in the various 'set' methods to do something like:
    setAttributeInternal(index, value);
    // somehow push the value in the EOHowever, programatically pushing the value in the EO from the VO seems trivial so far, but I'm not sure how good the result will be. I'll test it to see how well it works, but if there's any documentation about that subject that you know of, it would be appreciated.
    Thanks,
    ~ Simon

  • Log In using Query Rather Than a Table

    I am using CS5.
    I would to login but get the username and password from a query rather than a table.
    I am using ASP Vbscript.  The server behavior onlyl shows the tables, not the tables and queries.
    I can change the SQL and it works but there must a better way,.
    Thanks

    I don't think there is a better way. Defining a recordset based on a query is fine, but it's not something that DW handles natively.

  • I want Firefox to open a new session each time I use it rather than to try to recover my previous one; how do I go about this?

    What more details do you need? I want to open a new session when I use your product rather than have the product go through the slow tedious process of trying to recreate the previous session.

    Please see this support article on [[Session Restore]]. Follow the instructions under the "Configuring session restore" header. When you get to the step where it says "Show my windows and tabs from last time" you can choose from showing your homepage or showing a blank page instead.

  • How do I post iPhoto pictures to facebook using Firefox rather than Safari?

    When I want to post iPhoto pictures to facebook, and I click on the facebook icon in the lower right corner of the iPhoto page, my facebook page comes up in Safari, when I want it to come up using Firefox.  What do I need to do to make the facebook page come up in Firefox rather than Safari?  Any help would be appreciated.  Thanks.

    Make Firfox your Default Web Browser.

  • Why I use bing rather than google?

    What are the benefits of searching information in bing rather than google?

    read this:
    http://tech-beta.slashdot.org/story/11/08/14/0419213/bing-more-effective-than-google

  • Can't seem to draw a chart (line chart) using dates rather than numbers

    I'm trying to draw a Line Chart but rather using numbers i want to use dates for example: Switzerland 23/06/2008 - 23/08/2008. Can't seem to get it to work? it seems to all go wrong when I change the cell format to 'date'
    Can anyone help?
    Thanks
    PS. I can do it easily in Excel

    Hello
    From my point of view, it's not surprising.
    In XL, a date is a number to which a date format is applied. So, it may be charted.
    Same thing with the good old AppleWorks.
    With Numbers, a date is NOT a number, it IS a specific class of data.
    The consequence is that it can't be charted directly.
    Happily, we may easily convert a date into a number.
    In column B the formula is
    =A-$A$1
    which calculates the numeric difference between stored dates and the date stored in A1.
    So, we may chart the results.
    I know that it's far from perfect but we have to live with the choices made by Numbers's designers.
    Yvan KOENIG (from FRANCE vendredi 18 avril 2008 18:44:14)

Maybe you are looking for

  • Isight drivers for WIndows 7 - not working?

    Hi, Have a new IMac and am trying to get Isight working in a Parallels Windows 7 VM environment. Isight works fine in Mac OS (Skye, Oovoo, etc). Tried to install the drivers from the Mac OS disk (appleisightinstaller.exe) and they appear to be instal

  • Server console output

    Hi, I have been using flex from last six month. I have develped one application and now its time to deploy the application. But, I am facing one issue regarding server console output. In my application I have various remote call to java class deploye

  • Output Type in Sales Order

    Hi All.. Output type is not automatically selecting/ coming in sales order.. Condition record has been maintained in VV11 and I have also checked the configuration which seems okay to me.. Pls suggest where is the problem? thanks in advance

  • ORDImage, trouble set images properties

    Hello. I'm having trouble setproperties. I have the following procedure DECLARE Image ORDSYS.ORDImage; BEGIN SELECT image INTO Image FROM photos WHERE id = 1 for update; Image.setProperties(); DBMS_OUTPUT.PUT_LINE('image width =' || image.getWidth())

  • Load balancing /Clustring Xservers

    I am totally new to load balancing/clustering in X servers. This is my scenario, we need all the designers to start work from the server not on their systems. Only for rendering they would copy the file and throw back them to server. For this kind of