Professional Web Applications Themes

Javascript + Callbacks + Collision - Macromedia Director 3D

Hi there, I use Javascript instead of Lingo in my Director movies. I have a Javascript class which has a model as a class member, and I'm trying to set the collision callback on it. The name of the script it resides in is called "Start". The last line is complaining that it's not a function - yet the doentation clearly shows that it is. Any ideas? Does anyone have an example of this working in Javascript? Anywhere on the net I see are Lingo samples.:sad; function hit(me, collisionData) { put("Hitt!!"); } function Laser() { // model already properly set ...

  1. #1

    Default Javascript + Callbacks + Collision

    Hi there,

    I use Javascript instead of Lingo in my Director movies. I have a Javascript
    class which has a model as a class member, and I'm trying to set the collision
    callback on it. The name of the script it resides in is called "Start".

    The last line is complaining that it's not a function - yet the doentation
    clearly shows that it is. Any ideas? Does anyone have an example of this
    working in Javascript? Anywhere on the net I see are Lingo samples.:sad;



    function hit(me, collisionData)
    {
    put("Hitt!!");
    }

    function Laser()
    {
    // model already properly set
    this.model.addModifier(symbol("collision"));
    this.model.collision.mode = symbol("mesh");
    this.model.collision.setCollisionCallback(symbol(" hit"), member("Start"));
    /// is not a function!?!
    }

    Zen Guest

  2. #2

    Default Re: Javascript + Callbacks + Collision

    gotta use getPrpRef


    function hit(me, collisionData)
    {
    put("Hitt!!");
    }

    function Laser()
    {
    // model already properly set
    this.model.addModifier(symbol("collision"));
    this.model.getPropRef("collision").mode = symbol("mesh");
    this.model.getPropRef("collision").setCollisionCal lback(symbol("hit"),
    member("Start")); /// is a function
    }

    Ex Guest

  3. #3

    Default Re: Javascript + Callbacks + Collision

    Thanks alot man! I didn't realize that I needed to do that with collision,
    since it wasn't erroring out on me when I set the members directly. No error,
    but they weren't working either!

    Still having trouble getting collision set up, but that's at least one
    obstacle out of the way.

    Thanks again.

    Zen Guest

Similar Threads

  1. RFC - implementing callbacks
    By Gary Stainburn in forum PERL Beginners
    Replies: 9
    Last Post: February 12th, 07:16 PM
  2. exception in tk callbacks?
    By Ferenc Engard in forum Ruby
    Replies: 2
    Last Post: November 8th, 04:52 PM
  3. callbacks with lingo
    By James Tarling in forum Macromedia Director Lingo
    Replies: 2
    Last Post: July 11th, 03:24 PM
  4. OCI performance with user callbacks
    By Pablo Sanchez in forum Oracle Server
    Replies: 4
    Last Post: January 14th, 05:22 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139