- Home /
.NET code in Flash export (3.5 beta)
When trying to export to Flash using the 3.5 beta (3.5.0b6 to be exact), there are some SWF export problems, that seem to point to the fact that only a subset of .NET is implemented in AS3, so some of the methods are undefined.
The errors are of the kind:
Error building Player: Exception: Compiling SWF Failed:
(...)
Call to a possibly undefined method (...) through a reference with static type (...)
The undefined methods are all String
and List
operations, and all the XML
(`XmlDocument` and such).
Are these not supported because only a specific version of the .NET runtime is targeted? Maybe for this beta only a subset of .NET is implemented, but it will all be implemented in time?
I think there's only a subset of .NET currently implemented - will it change in the future? I have no idea.
However, I can tell you from experience none of the .NET Generics are currently implemented - your best bet is probably using ArrayLists ins$$anonymous$$d.
On the bright side, my own Type T templates compile just fine - which is an awesome feature considering AS3 itself does not support templates, and only has the Vector.T class available for templating :)
If you select the Flash build in build settings when you will see that the "Flash Player Subset" of .NET is targeted. Unfortunately it doesn't check against this in the Editor, only when you build your swf file. I assume the subset will grow over time, but that it will never be complete.
Regarding generic collections, with Unity 3.5.6f4 I can use List and Stack, but not LinkedList. So try the collection you want to use and see if it's available.
Answer by Julien-Lynge · Jan 11, 2012 at 12:59 AM
The Unity folks did specifically say earlier this year that only a subset of .NET and Unity functionality (e.g. no Networking) will be in place to start. I don't remember the exact wording, but something along the lines of "we're starting with the most common features and expanding support later."
There's a full list of supported and unsupported features linked from the 3.5 release notes:
http://unity3d.com/unity/preview/faq
Search for "Okay, so what works and what doesn't?"
Your answer
Follow this Question
Related Questions
ECDiffieHellmanCng missing from unity? 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
3.5 Flash Export - Compiles fine, but no resources 0 Answers
Flip over an object (smooth transition) 3 Answers