I'm trying to use CallFunction() to call a function inside a flash file, but no matter what I do it throws a HRESULT E_FAIL error. Any clues why? My flash version is 10 if you need it.
+2
A:
The HRESULT E_FAIL can be due to passing a wrong XML string to the AxShockwaveFlash.CallFunction's argument, or calling a function that is not registered with the ExternalInterface, but it can also be a result of a runtime-error occuring inside the Flash SWF file.
- Make sure your are passing a valid XML string as the argument (details on Flash's XML format can be found here). Keep in mind that ActionScript is case-sensitive.
- Make sure the function you're calling actually works well with the supplied arguments, by testing it from inside the Flash Actionscript code.
- Make sure your Actionscript function is properly registered with the ExternalInterface. Details of using the ExternalInterface for calling an actionscript function from the SWF's container can be found here.
- If you can't find the cause, please supply us with the relevant code of the vb.net method, the Actionscript function and Actionscript ExternalInterface registration.
M.A. Hanin
2010-03-03 18:18:50
1: I am2. I know it works3. I cant do that, is there a way around that?
Bubby4j
2010-03-04 22:53:18
Wrap the functionality with your own "proxy" functionality, and make sure each external function in your proxy is properly registered with the ExternalInterface.
M.A. Hanin
2010-03-04 23:41:42
Uhm. I cant edit the flash fine in any way. Any other way?
Bubby4j
2010-03-05 03:30:08
Not that I know of, sorry.
M.A. Hanin
2010-03-05 09:55:14
What if I could create a container for the flash file? Could I register the first file's functions with the ExternalInterface then?
Bubby4j
2010-03-05 14:16:17
No, because the contained SWF doesn't expose the functions you wish to trigger. The SWF file is like an object, who's public methods are only defined using the ExternalInterface.Since flash SWF is not native code but intermediate code, SWF files can be "imported" back to FLA files, enabling you to edit the source code. But if the original publisher of the SWF file applied the "import protection" you're going to have some trouble...
M.A. Hanin
2010-03-05 14:32:16
It's not that I cant edit it, It's that it has to remain on a server I don't own for it to connect to the server.
Bubby4j
2010-03-06 19:45:56
A:
Is there a way to call the Action Script if you do not have access to SWF file?
In the Adobe example there is an ExternalInterface reference, but do I understand correctly that there also needs to be an extarnal interface reference inside the Action script?
Or is this done by the AxShockwaveFlash control?
Ronald Schutte
2010-05-19 23:04:51