Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Dralamir · Mar 15, 2012 at 01:57 PM · errorflashcompile

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!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by HazeTI · Mar 15, 2012 at 08:47 PM

This may help you:

http://stackoverflow.com/questions/310820/how-to-check-if-two-objects-are-of-the-same-type-in-actionscript

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dralamir · Mar 16, 2012 at 08:03 AM 0
Share

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. :)

avatar image
0

Answer by Dralamir · Mar 16, 2012 at 08:37 AM

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. :)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Compiler error - how to fix it? 0 Answers

Modifying values on HingeJoints throwing errors when compiling for flash 0 Answers

Unity + SmarFox 2x via Flash export 0 Answers

windows 8.1, won't export out to win8 1 Answer

Problem with compiling [Target framework] 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges