A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Hit test (error?)

  1. #1
    Senior Member
    Join Date
    Apr 2009
    Posts
    138

    Question Hit test (error?)

    Hi,
    I have a player that you can control with the arrow keys.
    When you press the up arrow the character's _y changes depending on a _level0 variable set at the start of the swf file.
    When you move the character into a proxy, the proxy tells the character to move in the opposite direction
    (if you press up and hit the proxy then the character's _y is subtracted by the _level0 variable called "_level0.playerspeed"),
    the character appears that (s)he didn't move.

    At the start I had all my proxies on the stage as individual movie clips (but the rest of the movie clips [Ie. Grass, houses,
    tress, fences] including the player were created by a library linkage and the attach movie clip feature.

    This seemed a bit odd to me, so I was planning on turning the proxies into one big movie clip (Because I did not feel like
    figuring out where each proxies _x and _y coordinates should be) and then adding that to the stage via linkage.
    I didn't have a problem with this at the start.

    Eventually, I did not want to use the same proxies all the time (the stage updated when the player went into another area or
    house, and they needed to be rearranged and deleted) so I decided to add another frame to the movie clip containing
    the new proxies. Once a new frame was introduced there was an error appearing.

    Once the new frame was added the player could actually walk partially into the proxy and THEN it would register that the player hit
    the proxy and bounced him back. When one frame is used, this is done so fast it is not noticeable but with the addition of another
    frame you can actually see this bounce. What could be wrong with this? (There is no action script error reported)

    PS: By bounce I mean; Instead of the players (for example) _y seeming like it stays at 125, it instead goes from 125, then you can
    see it at 131 and then 125, but I would rather it appear to stay at 125, even if you are constantly walking into a proxy. This works
    with one frame but not too! Even if the second frame is on the root menu!

    whats up?

  2. #2
    Senior Member
    Join Date
    Apr 2009
    Posts
    138

    hmmm

    the introduction of a second frame within the main time line or even withing a movie clip causes this! I am not sure if this would change anything but this .swf file is loaded into another swf file and played.

    I hope some one can help!

Tags for this Thread

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