There is a ready-made flash movie with AS2 or AS1 (I don’t know for sure) placed on a form in C #, you need to set the values ​​of its global variables from C #, well, or Java (I don’t know from it, but if possible it will also come down). To do this, C # has the AxShockwaveFlash.SetVariable (string name, string value) function. It works, but only with local variables, with no global response, that is:

axShockwaveFlash.SetVariable("gVar.var", "3"); axShockwaveFlash.SetVariable("_global.gVar.var", "3"); 

and similar variations of the effect do not give (although the same easily works in the java script),

 axShockwaveFlash.SetVariable("localVar", "3"); 

it works great with local variables

Who knows, tell me what's the matter? Inet rummaged, but found no answer. Or maybe there are other options how to transfer the values ​​without rewriting the flash movie itself?

    1 answer 1

    As for global variables, I can’t say for sure, but you can access the properties of the swf form elements through _root. Also when organizing user interaction, Flash and C # used interface code in the form of properties, at the level of Flash movie AS2

     var getSomething = function ():Number { return Graph.Something; } var setSomething = function(value) { Graph.Something= Number(value); } _root.addProperty("FSomething", getSomething , setSomething ); 

    C #

     axShockwaveFlash.SetVariable("FSomething", "3"); axShockwaveFlash.GetVariable("FSomething"); 
    • Thanks for the answer :) Alas, but I can not do that, because I don't have Flash movie source codes - Gelay
    • You can try to access the properties of all objects on the movie from MovieClip to TextField, through _root. For example, using the TextField object's text property, you can change the value of a text field in Flash to your own. - askeet
    • Too it doesn't work through _root :( - Gelay