How do I use Javascript to access the variables in C #?

How do I use Javascript to access the variables in C #?

Data = GetComponent(“XMLData”);
DuckNo = Data.myData[0]._iUser.DuckNo;

error:Assets/scripts/start.js(98,39): BCE0019: ‘myData’ is not a member of ‘Object’.

:cry:

I want use Javascript change get or change c#. :?:

C# code needs to be in an earlier compile step.
Please check the advanced documentations of Unity on the topic.

that beeing said, your problem is that you try to use something thats of class Object as if it were of a different class.
JS on the iphone is static typed, not dynamic typed, so you need to have correctly typed variables and potentially cast things to get references to objects of the right classes and access their data.
your problem in this case is that you have an object data thats of class Object (thats what GetComponent returns if you check the script reference) but you use it as if it were an object of class XMLData

Thanks.

:frowning: ,

I get it. :stuck_out_tongue:

how to?? pls write a example.