- Home /
Unity 4.0 Flash Export load->unload->load crash
In Unity 3.5 Flash Export I could load the swf, unload and reload it without it crashing... now that i upgraded to 4.0 I'm getting this problem.
On first init everything loads fine and there are no problems. It hits shutdown and I do:
mUnityLoader.unityContent.setContentHost(null);
removeChild(mUnityLoader);
mUnityLoader.unload();
mUnityLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onUnityContentLoaderComplete);
mUnityLoader.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, onUnityContentLoaderProgress);
mUnityLoader = null;
Then when I hit the init again I do:
var params:UnityLoaderParams = new UnityLoaderParams(false, width, height, false);
mUnityLoader = new UnityContentLoader(UnityFileUtility.getSWFPath() + swfName, this, params, false);
mUnityLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onUnityContentLoaderComplete, false, 0, true);
mUnityLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onUnityContentLoaderProgress, false, 0, true);
mUnityLoader.loadUnity();
On this second pass it breaks before the load completes and I get this:
TypeError: Error #1034: Type Coercion failed: cannot convert System::ClassType@19da38c9 to System.Type. at System::Type$/ForClass() at System::CLIByteArray/CLIByteArray_Constructor_Vector$1_ByteArray() at System::CLIArrayFactory$/NewByteArrayWithLength() at System.Text::ASCIIEncoding/Encoding_GetBytes_String() at UnityEngine::WWWTranscoder$cinit() at global$init() at UnityEngineClassIndex$/InitializeClasses() at com.unity::UnityNative$/init_actionscript_cctors() at com.unity::UnityNative$/Native_Init() at com.unity::UnityContentInternal/initNativeEnvironment() at com.unity::UnityContent/onFrameInitStep()
Hello,
I have a side question for you. I have run into the problem of flash reloading (or something) and causing Unity to throw the old Fatal Error = null. Is this what you are referring to? For instance I am embedding Unity flash in powerpoint. When I get to a slide it loads fine the first time, but if I go back to it it throws the error. Is this a similar problem?