Trouble shooting


1. Exported Symbols don't show up in Unity

2. TextFields render as A: (CS4)

3. Exception: RpcFault 'Fatal error: Process failed, Record header length too big.'

4. Failed to convert X because the swf exporter process failed to start:

5. Unity locks up while exporting swf assets:

6. Jpeg artifacts appear on images:

7. OnPostprocessAllAssets Exception: System.Exception: Null response from rpc call 'cmd_processswf' Or the UniSWF application closes (CS4):

8. Small text doesn't appear very sharp on dynamic text fields:

9. Unity fails to start, exits immediately on launch or changing projects:

10. Black lines appear around boundary of image texture

11. MovieClip Filter Issues

12. Objects have an unwanted edge around them

13. Animations don't work when exported

14. Some characters don't show up in textfields

15. MovieClipBehaivour doesn't render with GlobalFog or DOF screen effect

16. Some exported symbols don't appear in the unity swf browser

17. DisplayObjects dissapear when adding to a MovieClip

18. The uniSWF Converter application is not installed

19. Mouse event listeners don't work

20. Missing MovieClip frames ( CS4 )

21. Everything displays as pink on the 2nd generation iPod Touch or using the opengl es 1 renderer

22. How do I enable text input fields on touch devices

23. RpcFault 'Fatal error: Process failed, Error #1065 ...

24. InteractiveMovieClipBehaviour (1.0.2) Triggers mouse events on buttons near coords x:0,y:0 when clicking outside the interactive movieclip

25. How do I use the SpriteSheetMovieClipBehaviour?

26. How do I enable Chinese, Japanese, and Korean Fonts?

27. MovieClip animation not aligned or positioned correctly

28. MovieClips returning as Sprites from getChildAt or getChildByName ( CS4 )

29. (Unity4.2) MovieClips don't always render layers in the same order

30. No exported symbols appear in Unity when using Flash CC

31. uniSWF Converter doesn't start due to SocketException ( Windows 8 )

32. Tweener.addTween() is not compatible with the argument list

33. flash.display::MorphShape not suported on DisplayObject

34. uniSWF Converter Air application install fails



Exported Symbols don't show up in Unity


Open the source FLA file, select the asset in library then click properties, ensure export in frame 1 is selected.


TextFields render as A: (CS4)


A known Flash CS4 issue, create a new FLA and copy all library asset into the new FLA and re-publish.


Exception: RpcFault 'Fatal error: Process failed, Record header length too big.'


Change stage size in the source FLA asset to a smaller size eg. 640x480.


Failed to convert X because the swf exporter process failed to start:


Close unity and uniSWF then restart unity, optionally try manually starting uniSWF from the programs/application menu.


Unity locks up while exporting swf assets:


Quit the uniSWF application and re-export the last file again.


Jpeg artifacts appear on images:


Set the compression in the publish settings in the source FLA to 100% File->Publish Setting->Flash(tab)->JPEG Quality to 100%


OnPostprocessAllAssets Exception: System.Exception: Null response from rpc call 'cmd_processswf' Or the UniSWF application closes (CS4):


Known Flash CS 4 issue when exported symbols changed from a SimpleButton to MovieClip in the Symbol Properties window, the solution is to remove the symbol and copy its contents into a new MovieClip or SimpleButton or export in CS 5 or above. To find the corrupted symbols check the Symbols name under the Source section at the bottom of the Symbol Properties window, this normally should be blank.


Small text doesn't appear very sharp on dynamic text fields:


Try changing the anti-alias type to Bitmap text [no anti-alias].


Unity fails to start, exits immediately on launch or changing projects:


Backup your project first, remove MonoManager.asset and the ScriptAssemblies/ folder in the /Library of the startup/current project.


Black lines appear around boundary of image texture


Known issue with large textures, first, ensure the exported texture dimensions are a sufficient size, this is set by selecting the swf file and accessing the uniSWF export options, adjust Texture output size accordingly. If the issue persists, locate the exported texture in the Resources folder and select it, and in the inspector click on "Texture Type" and select "Advanced", change filter mode to "Point" and apply changes.


MovieClip Filter Issues


Movieclips with Filter effects are best put into one fla and exported with "Exported nested MovieClips" feature checked off. Make sure the movieclip with the filter effect is inside a holding Movieclip (make sure the linkage is exported) and ensure the movieclip within the holding clip( the one with the filter applied) is NOT exported.


Objects have an unwanted edge around them


Select the textures in the resource folder and change the wrap mode to clamp, this is due to a known issue when doing UV rounding and scaling down, this will be resolve shortly in a future version.


Failing that try making the texture size bigger.


Try making the asset smaller so it fits into the texture size.


Animations don't work when exported


Export all child animations as Movieclips.


Some characters don't show up in textfields


Embed characters using the Export options->fonts->charset/embed characters


MovieClipBehaivour doesn't render with GlobalFog or DOF screen effect


Currently not supported but a work around is possible by the following shader, please note this will create some warnings in the console due to missing normals which will be resolved in future releases, also doesn't support alpha blending very well so try to keep everything in a rectangle:


Shader "uniSWF/Transparent/DiffuseTexDoubeSidedAlphaGlobalFogCompat" {
    
    /*
        Test shader for use with global fog and DOF.
        
        Notes:      
            - will generate a load of "Shader wants normals, but the mesh  doesn't have them" until lib is updated with normals enabled.
            - This will apply to any overlays, future versions will have separate shaders
    */
    
    Properties {
        _Color ("Color", Color) = (1,1,1,1)
        _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    }   
    
    SubShader {
        Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
        LOD 200
    
            
        CGPROGRAM
        #pragma surface surf Lambert alpha
        
        sampler2D _MainTex;
        fixed4 _Color;
        
        struct Input {
            float2 uv_MainTex;
            float4 color: Color; // Vertex color
        };
        
        void surf (Input IN, inout SurfaceOutput o) {
            half4 c = tex2D (_MainTex, IN.uv_MainTex);
            o.Albedo = c.rgb * IN.color.rgb * 4; 
            o.Alpha = c.a * IN.color.a; 
        }
        ENDCG
    }
    
    Fallback "Transparent/VertexLit"
}


Some exported symbols don't appear in the unity swf browser


Know issue with older version of flash, creates incompatible swf's caused by one or more bad asset references in the library. A solution is to isolate the bad asset in the FLA by doing the following work flow:

- Create a new Actionscript 3 fla document ( file->new )
- Copy a single export to the library in the new fla
- Save and publush
- Check if symbol shows in unity ( Window->uniSWF->Swf URi Browser )
- If the symbols shows then copy another
- Repeat until none or some of the exports go missing, once encounted do the following
- Remove a layer, then publish
- Do the same until all the symbols re-appear
- That is the offending layer/asset, consider removing, re-importing or recreating it.

DisplayObjects dissapear when adding to a MovieClip


As of uniSWF 1.0.2 and below the MovieClip player will remove any DisplayObjects that are not part of the exported asset ( even if no assets are assigned ), the solution is to call MovieClip.stop(), If animation is used then you will need to re-add the objects every frame. If you don't require any exported asset support use the DisplayObjectContainer as a alternative.


The uniSWF Converter application is not installed


First make sure the Air app (uniSwf/installer/uniSWF.air) is installed. uniSWF assumes its installed in the /Applications folder on a mac and in c:/Program Files on XP and c:/Program files(x86) on vista/win7. If you are using a custom install path go window->uniSWF->Export Options, then expand the preferences section and browse for the "uniSWF Converter" application installed from the "uniSWF.air" installer.

For the trial version the paths will be "C:/Program Files (x86)/uniSWF Converter Trial/uniSWF Converter Trial.exe" for windows and "/Applications/uniSWF Converter Trial.app" for OSX


Mouse event listeners don't work


Possible cause is when DisplayObjects above the button are absorbing the click, one common issue is when a screen fade overlay is set to 0% alpha, to resolve this is to set the visible=false or clear the keyframe when it gets to 0%.


Missing MovieClip frames ( CS4 )


Caused by a possibly corrupt swf file from CS4, simply select all the assets in the library and paste into a new FLA, overwrite the original file once everything works.


Everything displays as pink on the 2nd generation iPod Touch or using the opengl es 1 renderer


Issue will be resolved in future versions, a quick fix is to replace the contents of shader "uniSWF-Double-Alpha-Diffuse" with the following:


Shader "Transparent/DiffuseDoubeSided" {

Properties {
    _Color ("Color", Color) = (1,1,1,1) 
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}

Category {
    Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
    Blend SrcAlpha OneMinusSrcAlpha
    Cull Off ZWrite Off Fog { Color (0,0,0,0) }

    Lighting Off
    Material { Emission [_Color] }
    ColorMaterial AmbientAndDiffuse

    SubShader {
        Pass {
            SetTexture [_MainTex] {
                combine texture * primary
            }
        }
    }
}

}


How do I enable text input fields on touch devices


Currently uniSWF doesn't handle text input by default but there is a way to add this on a per text field basis using the following code.

There are two input fields called "user_txt" and "pass_txt" used for a simple login form, change these to the textfield names you require input on. The FocusEvent will be listened on to trigger the touch keyboard, once focused the text will be captured from the TouchScreenKeyboard to the TextField.

This has been tested on iOS and Android and will be merged into the main uniSWF package in future updates.




#pragma strict
import pumpkin.display;
import pumpkin.text;
import pumpkin.events;

var activeInput:TextField = null;
var prevTest:String = "";
var keyboardType:TouchScreenKeyboardType = TouchScreenKeyboardType.Default ;
private var keyboard : TouchScreenKeyboard;
private var lastTxt:String;
private var stage:Stage ;


function Start () {

    stage = GetComponent(MovieClipOverlayCameraBehaviour).stage;    
    var mc:MovieClip = new MovieClip( "swf/menu_wireframes.swf:Login" );    
    stage.addChild(mc);
    
    // Get texfield and listen for focus change events
    var user_txt:TextField = mc.getChildByName.<TextField>("user_txt");
    user_txt.addEventListener( FocusEvent.FOCUS_IN, onFocusIn );
    user_txt.addEventListener( FocusEvent.FOCUS_OUT, onFocusOut );
    
    var pass_txt:TextField = mc.getChildByName.<TextField>("pass_txt");
    pass_txt.addEventListener( FocusEvent.FOCUS_IN, onFocusIn );
    pass_txt.addEventListener( FocusEvent.FOCUS_OUT, onFocusOut );  
    
    Input.imeCompositionMode = IMECompositionMode.On;
}

function onFocusIn( e:FocusEvent ) {
    var txt:TextField = e.currentTarget as TextField;   
    
    // Set text for input change detection
    prevTest = txt.text;    
    lastTxt = prevTest;
    
    // Open keyboard on focus change
    keyboard = TouchScreenKeyboard.Open(prevTest, keyboardType );
    
    activeInput = txt;
}


function onFocusOut( e:FocusEvent ) {
    var txt:TextField = e.currentTarget as TextField;
    
    // Clear target on focus change
    activeInput = null;
    keyboard = null;    
}


function Update() {

    // Check target field
    if( keyboard != null && activeInput != null ) {

        // Detect keyboard close
        if( !keyboard.active ) {
            
            // Set final value
            activeInput.text = keyboard.text;
                
            // Clear keyboard
            keyboard = null;

            // Clear focus
            stage.focus = null;
            
        } else {
        
            // Check input change
            if( keyboard.text != lastTxt ) {
            
                // Update text field
                lastTxt = keyboard.text;
                activeInput.text = lastTxt;             
            }
        }       
    }

}


RpcFault 'Fatal error: Process failed, Error #1065 ...


UniSWF doesnt support AS3 as you need to port your code to UnityScript, the Error #1065 is an actionscript error, try removing any ActionScript from the timeline and remove any main classes.


InteractiveMovieClipBehaviour (1.0.2) Triggers mouse events on buttons near coords x:0,y:0 when clicking outside the interactive movieclip


Known issue due to the ray test returns 0,0 when clicking outside the collider, which in turn fires events on any sprite that exists under the x:0,y:0 position.



One possible solution is to make sure no objects exist under the x:0,y:0 position on the stage ( global space ), Another way is to override the input handler to detect if the mouse is inside the collider, see below:



This has been fixed in version 1.0.3beta. Also this issue doesn't exist with the MovieClipOverlayCameraBehaviour so maybe consider using that instead if the UI is overlay based.




#pragma strict

import pumpkin.display;
import pumpkin.events;

class MovieClipBehaivourOutOfColliderMouseBug extends InteractiveMovieClipBehaviour {

    function OnStart () {
    
        var mc:MovieClip = new MovieClip( "swf/button.swf:button" );
        mc.stopAll();
        
        mc.addEventListener( MouseEvent.CLICK,function(e:MouseEvent) {
            Debug.Log("Click");
        });
    
        stage.addChild(mc); 
    }
    
    function Update () {
        super.Update();     
    }
    
    override function handleUserInput() {
    
        if( collider ) {
            var cam:Camera = mouseInputCamera != null ? mouseInputCamera : findMainCamera();
            
            var ray:Ray = cam.ScreenPointToRay(Input.mousePosition); // create ray from mouse coord
            var info:RaycastHit ;
                
            if(!collider.Raycast(ray,info, 99999)) // perform hit test
            {
                return;
            }
        }
        super.handleUserInput(  );
        
    }
}


How do I use the SpriteSheetMovieClipBehaviour?


The SpriteSheetMovieClipBehaviour manages the AnimSpriteSheet class for general use in Unity. The AnimSpriteSheet converts MovieClips into a pre-allocated static Mesh, it then moves the mesh points into place for each frame for example if frame 1 of the MovieClip has 100 sprites and frame 2 had 1 sprite, the mesh will still contain 600 points but on frame two 594 of the points will be moved to zero. One of the main advantages using this class is to remove the overhead of the MovieClip player class during run time.



The following code creates a sprite sheet and stops on frame 1, you can also create and configure the SpriteSheetMovieClipBehaviour through the Unity property inspector.



using UnityEngine; using System.Collections;

public class SpriteSheetBehaviourTest : MonoBehaviour {

void Start () {

    GameObject go = new GameObject();
    SpriteSheetMovieClipBehaviour spriteSheet = go.AddComponent<SpriteSheetMovieClipBehaviour>();
    spriteSheet.movieClip = "swf/movieclip/char_1.swf";   // Movieclip name
    spriteSheet.symbolName = "char1_legs_N";   // Export name
    spriteSheet.Awake(); // Refresh

    spriteSheet.spriteSheet.stop();
    spriteSheet.spriteSheet.setFrame( 1 );
}

}


How do I enable Chinese, Japanese, and Korean Fonts?


Select the .swf file in the project view, then go window -> uniSWF -> Export options and you should see this:

Alt text

Then expand fonts and character sets, you should see CJK Unified Ideograph, enable this to export common japanese and korean characters in fonts that are in that swf.



To add extra characters such as CJK punchations ( http://unicode.org/charts/PDF/U3000.pdf you need add to the "Embed unicode range" eg. 4E00-9FFF,3008-300B to add 〈 》punchuation marks.


MovieClip animation not aligned or positioned correctly


Ensure 3D transform are not used in any animation as uniSWF does not support this feature. To check open flash, select the object then open the transform window ( Window->Transform) and click the "Reset transform" button.


MovieClips returning as Sprites from getChildAt or getChildByName ( CS4 )


Known issues with CS4 FLA corruption, to resolve simply select all exported symbols in the Library and copy them into a new FLA document.


(Unity4.2) MovieClips don't always render layers in the same order



No exported symbols appear in Unity when using Flash CC


Flash 11 is not currently supported. Change the flash target version to 10.0 or the nearest 10.x version. Go File->Publish settings and change the Target drop down list.

In Flash ensure all fonts are embedded and there are no compile errors, to note compile errors will not trigger if there are font any embed warnings.


uniSWF Converter doesn't start due to SocketException ( Windows 8 )


This is caused by the windows firewall blocking the uniSWF communication socket, to resolve the issue do the following:

  1. Close Unity.

  2. Reset the windows firewall: http://windows.microsoft.com/en-gb/windows7/restore-windows-firewall-settings

  3. Open the uniSWF converter ( from start menu or ProgramFiles/Uniswf Converter etc )

Click Allow network access when prompted by the windows firewall;.

  1. Open Unity

  2. Window->uniSWF->Welcome

This should display the uniSWF converter application installed message.


Tweener.addTween() is not compatible with the argument list


The uniSWF API was updated to remove Hash tables for WP8 compatibility, to resolve this you will need to convert the Boo.Lang.Hash/Hashtable arg to a Dictionary<string,object>, the easy way to do this is to use the Tweener.Hash().

previous method


Tweener.addTween( mc, { "x": 100, "y": 200 } )

current method:


Tweener.addTween( mc, Tweener.hash( "x", 100, "y", 200 ) )

flash.display::MorphShape not suported on DisplayObject


Currently Shape tweens are not supported. There is a work around to this, you can convert shape tweens to vector shapes by selecting the frame range of the shape tween, right click and select "Convert to Frame-by-Frame Animation".


uniSWF Converter Air application install fails


This was caused due to the certificate expiration of the converter application in 2.0.4 and below, please install a later version 2.0.6 or above.