3 Replies Latest reply on Feb 4, 2009 7:06 PM by kglad

    help writing a class

    brian914 Level 1
      Trying to learn how to write a class. I had this AS for a video player that was working in my file and I am trying to learn how to move code like it into a class.

      I am doing what I think I need to, but am getting a bunch of errors that I don't know what to do with.

      My class starts like this and I am getting the following error:

      import mx.utils.Delegate;

      class VideoPlayer extends MovieClip{

      private var nc:NetConnection = new NetConnection();
      nc.connect(null);


      The nc.connect(null); part is giving me the following error message:
      "This statement is not permitted in a class definition."

      Why is that and how do I get around that?

      Thank you very much for any help!