5 Replies Latest reply on Apr 6, 2007 10:47 AM by brunoseivam

    Weird type mismatch

      The problem is the following:
      I've created two classes, one called Corpo and another called KeyManager.
      The Corpo class is a body in a game, like a rock, a tree, the character, etc...
      The KeyManager class manages all the key inputs and passes the action associated to the key pressed to the object of the class Corpo (further, i'll create a subclass of Corpo named Char or sth like that, cuz just a char receive actions from keyboard)
      so, the class KeyManager is created this way:

      var km:KeyManager=new KeyManager(target);

      where target is the Corpo object that will be associated to the km
      i'm using strong typing so the "target" is an object of the Corpo class
      but, inside KM class, occurs an error
      i try to put the "target" reference onto a variable predefined, as shown at the end of the message:

      and then i compile, it returns:

      Type mismatch in assignment statement: found Corpo where String is required.

      i've tried a lot and didn't find a solution

      sorry if i've been so extensive
      thks since now