Call C# function from within as3?

Hi! I have as3 class. I want to call C# function.
Doing something like:

import global.MyClass


_myClass.MoveMouse()

produced errors.

I have example on how to sent whole Object from as3 to Unity, but I don’t need that.
I just want to sent mouse position from as3 to my Unity function like MouseMove(2,2)

Thanks!

It’s hard to see what your exact issue is without a copy of the source or your errors.

Without seeing your project, the first thing I’d say to check is that your C# class uses the [NotRenamed] attribute for the class/functions. This will ensure they have the same names when converted to AS3 at build time.

What is the reason for getting the mouse position in AS3 and returning that to C#? Can you not just make use of the Input.mousePosition value directly in your C# class?

I’ve attached a demo project which shows the Input.mousePosition value working for Flash export. If you build this project for Flash, you should see a texture following the mouse cursor.

[2754-customcursor.zip|2754]