dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Testing source code

  1. #1
    Senior Member
    Join Date
    Dec 2010
    Posts
    121

    resolved [RESOLVED] Testing source code

    Hi, I'm reading through a book called AdvancED Game Design with Flash, where I think the source code has some problems. You can get the source code for the book from here: http://www.apress.com/downloadable/d...sample_id/760/, the project I'm having problem on is chapter01, VerletIntegration. I keep getting Warning 1090 for the KeyboardEvent listeners in Flash Pro, even though I've tried copying the publisher's source code into the project.

    Can you please test it out and tell me whether their source is incorrect? Thanks.

  2. #2
    Senior Member guardiankitty's Avatar
    Join Date
    Dec 2006
    Location
    Here
    Posts
    215
    Well, it seems that the folder: Chaper01\VerletIntegration is trying to initialize the classes StatusBox and StageBoundaries, Both of which are not supplied with the zip that you have provided (or I did not find them easily enough).

    I just commented those classes out (I think the first is just a textfield, and the second is a way to keep the supplied movie on the visible stage).

    It runs just fine. HOWEVER there are warnings in the flash IDE about 'onKeyDown' and 'onKeyUp' Events (hence your original question). The 'warnings' (which could be ignored without any negative consequences) are put there just to 'remind' the programmer that this is in fact AS3, not 1 or 2. The 'onKeyDown' method attached to a movieclip did something much different in earlier version of as, from what it does now in as3 (which is nothing- its just a method like any other). Because of the warnings, it is somewhat a faux pas to create any functions with the names: onPress, onRelease, onKeyDown, onKeyUp or onEnterFrame. The 'programmer' of the class Player.as did not conform to this norm, hence the warning (see lines: 89 and 108 in Player.as).


    Hope that is helpful, so in short it works and you are fine =3
    ~GK>'.'<
    Last edited by guardiankitty; 01-04-2012 at 08:41 PM.

  3. #3
    Senior Member
    Join Date
    Dec 2010
    Posts
    121
    Thank you for your reply. Changing onKeyDown and onKeyUp to something else indeed stopped Flash from popping up the warning and let the SWF run.

  4. #4
    Senior Member guardiankitty's Avatar
    Join Date
    Dec 2006
    Location
    Here
    Posts
    215
    Good to hear and happy coding!

    Also if you run into any other issues or need any other help be sure to let us know!

    Best of luck,
    -GK

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center