Search Unity

Compiling to Flash Erorrs

Discussion in 'Flash' started by Draco18s, Jul 12, 2012.

  1. Draco18s

    Draco18s

    Joined:
    Aug 15, 2011
    Posts:
    110
    I can't view the source for these, as they appear to be inside the actionscript source as Unity attempts to build the swf, not the original source code. The errors are listed as coming from a .as file, not the .cs which is the original source.

    I'm using iTween, which is the code that will not properly convert/compile

    Line 250, col 41: Call to possibly undefined method IClonable_Clone through a reference with static type System.Collections:Hashtable
    Line 336, col 41: (Same error)
    Line 1284, col 79: Implicit coercion of a value of type void to an unrelated type Object.
    Line 1288 (same as above)
    Line 1299 (same as above)
    Line 3798, col 84: Call to a possibly undefined method Enum_Parse_Type_String_Boolean through a reference with static type Class.
    Line 3812 (same)
    Line 3826 (same)
    Line 3840 (same)

    One from iTweenPath:

    Line 74, col 122: Call to a possibly undefined method List$1_GetRange_Int32_Int32 through a reference with static type System.Collections.Generic:List$1

    And one more:

    Code (csharp):
    1. Error Building Player: Exception: Compiling SWF Failed:
    2. Loading build configuration file [file location]\flex-config.xml
    3.  
    4. iTween.as Line 250, col 41: Call to a possibly undefined method IClonable_Clone through a reference with static type System.Collections:Hashtable.
    5.  
    6. var $hastable: Hashtable = $args.IClonable_Clone() as Hashtable;
     
  2. catburton

    catburton

    Joined:
    Mar 29, 2011
    Posts:
    43
    You can view the converted .as files, they are stored in the following folder in your project:
    /Temp/StagingArea/Data/ConvertedDotNetCode/

    The conversion issues for iTween have been addressed for 4.0. Until 4.0 you'll have to work around these issues by fixing any conversion issues manually.
     
  3. mtoivo

    mtoivo

    Joined:
    Jul 30, 2012
    Posts:
    274
    Bumping the thread because I just got the iTweenPath -addon working with flash export. iTween itself can be fixed by downloading flash-patched version from here: http://blog.almostlogical.com/2011/12/22/unity-to-flash-exporter-with-itween/. iTweenPath can be fixed for compile by commenting out the "GetPathReversed" -method alltogether from iTweenPath.cs (after that, you of course cannot call that method anymor). If you want to use paths (which I take you do), you have to fix the "GenerateMoveToPathTargets" from (the already patched) iTween.cs, because it will not identify the supplied path correctly as an array of Vector3. I did this the following way: Find the method "GenerateMoveToPathTargets" and replace this first comparsion line:
    Code (csharp):
    1. if(tweenArguments["path"].GetType() == typeof(Vector3[])){
    with this:
    Code (csharp):
    1. if((String)tweenArguments["pathtype"] == "Vector3"){
    Now, when you supply the path for iTween (for for example MoveTo) in the Hashtable, you have to add element "pathtype" and set it to "Vector3". I know, it's a quick and dirty patch mainly to get things working for me, hope it might help someone else, too.
     
    Last edited: Aug 14, 2012