A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: ok... whats wrong with this code snipit????

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    283
    onClipEvent (enterFrame) {
    if (_root.maze2.hittest(blast._x,blast._y, true) ==true) {
    with (_root.blast) {
    gotoAndPlay ("boom");
    }
    }
    }

    ..if the MC blast hittests with maze2 then within the root of blast.. goto and play frame label boom... what is wrong?
    [Edited by tartarsause on 04-09-2001 at 03:11 AM]

  2. #2
    Senior Member
    Join Date
    Mar 2001
    Posts
    283
    the code works when its in the main time line.. however I would like to have it in a MC or button object for keeping track of it easyer.

  3. #3
    I think _root.maze2 is what's wrong because as far as I know _root reffers to the root of the current (not necessarily main) timeline. Did you try with _level0.maze2?

  4. #4
    Senior Member Olorin's Avatar
    Join Date
    Aug 2000
    Posts
    1,151
    onClipEvent (enterFrame) {
    if (_root.maze2.hittest(_root.blast._x,_root.blast._y , true)) {
    with (_root.blast) {
    gotoAndPlay ("boom");
    }
    }
    }

    This looks like it should work...

    Olorin

  5. #5
    Junior Member
    Join Date
    Apr 2001
    Posts
    24
    i notice when I'm typing in hitTest in the action window it doesn't turn blue unless you have it in that case.. you have the 2nd t lowercase... dunno if that matters, but that's what I notice first

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