x


Flash compile problem: typeof() does not translate

Hello all, first post here. Bear with me. :)

I am trying to compile my game into a Flash version and, no surprise, there are compile problems with the preview version. I am trying to do a workaround to the Messenger script. When compiling to Flash the function typeof() yields the following error:

(projectpath)\Temp\StagingArea\Data\ConvertedDotNetCode\global\Messenger.as(106): col: 46 Error: Call to a possibly undefined method UnityRuntimeServices_GetTypeOf_Object through a reference with static type Class.

So I tried stuff like ObjectNames.GetClassName() on the class (which extends System.Object), but that yields the following error:

Assets/Assets/Scripts/Messenger/Message.js(20,70): BCE0017: The best overload for the method 'UnityEditor.ObjectNames.GetClassName(UnityEngine.Object)' is not compatible with the argument list '(Message)'.

So the point is to convert the class name into a string somehow. I'm new to Unity so my grasp on JavaScript / C# is shaky as of yet. Cheers in advance for any help!

more ▼

asked Mar 15 '12 at 01:57 PM

Dralamir gravatar image

Dralamir
16 1 2 3

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first
more ▼

answered Mar 15 '12 at 08:47 PM

HazeTI gravatar image

HazeTI
346 9 14 17

Thanks for your reply, Haze.

We did look into getQualifiedClassName, but the problem is that there's apparently no function on Unity's end that would be converted into getQualifiedClassName upon compile to Flash.

Fortunately I figured out a way to circumvent the issue having slept on it. :)

Mar 16 '12 at 08:03 AM Dralamir
(comments are locked)
10|3000 characters needed characters left

Thanks for the reply, Haze.

Unfortunately we looked at getQualifiedClassName as well, forgot to mention that. The problem with that is that I should have a function that works in JavaScript/C# (instead of typeof) that is converted into getQualifiedClassName upon Flash compilation.

Fortunately, having slept on it I figured out a workaround to circumvent the problem. Obviously a proper solution to the function conversion would be ideal at some point. :)

more ▼

answered Mar 16 '12 at 08:37 AM

Dralamir gravatar image

Dralamir
16 1 2 3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2032
x278
x75

asked: Mar 15 '12 at 01:57 PM

Seen: 501 times

Last Updated: Mar 16 '12 at 08:37 AM