2 Replies Latest reply on Dec 18, 2006 8:53 AM by leftblank

    parent script problem

    leftblank
      Hi, i'm trying to implement a bat and ball game in lingo, and i'm just trying to get my ball travelling from one corner of the creen to the opposite corner for now. I have set up a parent script named ballScript to initialize and control the ball sprite currently in sprite number 2, but when I try 'myObj = new(script "ballScript" 2)' in the message window i get the following output:

      .== Script: (member 0 of castLib 0) Handler:
      --> myObj = new(script "ballScript" 2)
      == Script: (member 5 of castLib 1) Handler: new
      --> pMySpriteChannel = useSpriteNum
      == pMySpriteChannel = 2
      --> pXDirection = 1
      == pXDirection = 1
      --> pYDirection = 0
      == PYDirection = 0
      --> end
      == Script: (member 0 of castLib 0) Handler:
      --> myObj = new(script "ballScript" 2)
      == myObj = <Void>


      Why isn't it assigning the object to my new variable correctly? Here is my parent script:


      property pXDirection, pYDirection, pMySpriteChannel

      on new me, useSpriteNum
      pMySpriteChannel = useSpriteNum
      pXDirection = 1
      pYDirection = 1
      end

      on initBall me
      sprite(pMySpriteChannel).loc = point(4, 4)
      end

      on animate me
      sprite(pMySpriteChannel).locH = sprite(pMySpriteChannel).locH + pXDirection
      sprite(pMySpriteChannel).locV = sprite(pMySpriteChannel).locV + pYDirection
      end


      Thanks