This content has been marked as final. Show 9 replies
You need to pass the values via the HTML wrapper <object> and <embed> tags using FlashVars (or query string on the SWF url). Then inside your Flex application you can access those values using the Application class's parameters property.
There is no way to directly access a DLL from within the Flash Player.
if the DLL comes first in the scenario and loads a swf, can this also pass values to swf gobal vars?
I assume the DLL is making the request for the SWF using a URL. So all you need to do is append query parameters to the URL and those name=value pairs will be able from the parameters property of the mx:Application object.
if i access a value through for example 'Application.application.parameters.myVar', would it also mean that when i set values in the dll the 'myVar' is as it is, meaning no more required prefixes and this gives value to the global var in Flex?
sorry, for so many questions. :D
No, the values are passed to the SWF on the URL for the SWF. That's it. Any changes in the DLL will not be visible in the SWF - the Flash Player is isolated from the DLL.
Also, application.parameters.myVar isn't technically a global - it is just a property of the Application object.
how do i get DLL values suppose this DLL gives something to a variable in Flex?
there are no changes in the dll. it just loads swf and gives values to variable at the beginning. but how can flex swf get that? if it is not through Application.application.parameters?
The Flash Player cannot interact with a DLL or other ActiveX controls. The only thing you can do is supply values when the DLL requests the SWF on its url:
Once the SWF has loaded, application.parameters.p1 will be value1, application.parameters.p2 will be value2.
That's all there is.
if a DLL sets a variable value to something like '_root.myVar', AS2 receives such value when the swf is played (provided it also has a _root.myVar variable).
With As3 and Flex what then should be used so that it receives the value given by DLL? maybe something equivalent or replacement to '_root.'
In DLL there is this line of code:
myText is the string value given to the AS2 swf. And in As2 swf, there is this _root.myVar also. This works but
What could be Flex and As3 equal approach to this? I think DLL might also change. but what could be the changes for AS3?