5 Replies Latest reply: Nov 6, 2014 8:01 AM by Amy Blankenship RSS

    Getter Setter strange problem in interface

    vakhtangi Community Member

      hi folks I have a strange compiler error

       

      package  {
        public interface IGet{
        function get someInt():int;
        }
      }
      

       

      package  {
        public interface ISet {
        function set someInt(value:int):void;
        }
      }
      

       

      package  {
        public interface ISomeInt extends IGet, ISet{
        }
      }
      

       

      package {
        public class SomeInt implements ISomeInt {
        public function SomeInt () {
        }
        public function set someInt (value:int):void {
        }
        public function get someInt ():int {
        return 157;
        }
        }
      }
      

       

      package  {
        import flash.display.MovieClip;
        public class InitSomeInt extends MovieClip{
        public function InitSomeInt() {
        var so:ISomeInt = new SomeInt;
        so.someInt = 15;
        }
        }
      }
      

       

      compiler says: 1059: Property is read-only.

       

      any solutions?





      ction set someInt