lundi 28 septembre 2015

how fix overloaded constructor in actionscript

I have error in SWF project. I have this class

package managers.styles
{
   import com.codeazur.as3swf.*;
   import com.codeazur.as3swf.tags.*;

   public class CSSStyleManager extends Object
   {

      private static var _swf:SWF;

      public function CSSStyleManager()
      {
         super();
      }

      public static function setStyle(cls:Class) : void
      {
         _swf = new SWF(new cls());
      }

      public static function getCustomStyleName() : String
      {
         var len:uint = _swf.tags.length;
         for(var i:uint = 0; i < len; )
         {
            if(_swf.tags[i].type == TagCustom.TYPE)
            {
               return TagCustom(_swf.tags[i]).readString();
            }
            i++;
         }
         return "";
      }
   }
}

in function getCustomStyleName have function TagCustom(_swf.tags[i]), but in project have only this TagCustom class without parameter in constructor

package com.codeazur.as3swf.tags
{
   import com.codeazur.as3swf.*;

   public class TagCustom extends Object implements ITag
   {

      public static const TYPE:uint = 100;

      public var customData:SWFData;

      public function TagCustom()
      {
         this.customData = new SWFData();
         super();
      }

      public function parse(data:SWFData, length:uint, version:uint, async:Boolean = false) : void
      {
         data.readBytes(this.customData);
      }

      public function publish(data:SWFData, version:uint) : void
      {
         var body:SWFData = new SWFData();
         body.writeBytes(this.customData);
         data.writeTagHeader(this.type,body.length);
         data.writeBytes(body);
      }

      public function writeString(str:String) : void
      {
         this.customData.writeString(str);
      }

      public function readString() : String
      {
         return this.customData.readString();
      }

      public function get type() : uint
      {
         return TYPE;
      }

      public function get name() : String
      {
         return "CustomTag";
      }

      public function get version() : uint
      {
         return 1;
      }

      public function get level() : uint
      {
         return 1;
      }

      public function toString(indent:uint = 0) : String
      {
         var str:String = Tag.toStringCommon(this.type,this.name,indent);
         str = str + (" customData length=" + this.customData.length);
         return str;
      }
   }
}

how I can understand what is a happen

Aucun commentaire:

Enregistrer un commentaire