0
votes

I don't know why, but in the old days of Flash 8 Flash featured a very useful WebService class I extensively used: this class had been removed in the next versions of the software BUT FlashBuilder IDE (that is Flex) lets you call WebService methods very easily through a dedicated API.

If, using Flex, I compile a swf file with a custom class that uses WebService API, is it possibile to load it in a Flash swf and call the methods of the class from the Flash-compiled-swf? How?

1
So, you want to create a Flex class, compile it to a swf, to then be loaded into Flash so that you can load the Flex swf into your Flash one, to call one method? Ever heard of the KISS concept?J_A_X
your webservice can probably be called quite easily using the URLLoader class. what are you trying to do?divillysausages
@J_A_X: yes, I want to call many methods of my custom WebService class made in Flex from Flash. And I really don't know what is the KISS concept...user840248
@divillysausages: maybe if you Google a little and read some excerpts from some books you will find that you can only use some horrible workarounds without the WebService API. In my case, I feel the best way would be the one I proposed, but I'm here asking if it will work.user840248
@J_A_X: if "KISS" means "Keep it simple" I think this is a pretty simple solution: basically I use Flex as a component, I load it in my Flash swf and I invoke its methods receiving data from the server and dispatching an Event to send data to the Flash swf. Nothing simpler...user840248

1 Answers

0
votes

i hope i understand your question in a right way. Do you want to know, if its in general possible to access a swf written in flex from flash8.

There are some limitations. ActionScript1 and Actionscript 2 require the AVM1 (ActionScript Virtual Machine) from e.g. FlashPlayer10. ActionScript3 requires the AVM2. FP10 supports both AVMs but:

a SWF must contain AS1 and/or AS2 or only AS3. AS3-Code can load a swf, written in AS1 and/or AS2, but can't access its variables or functions. SWFs written in AS1 and/or AS2 can NOT load a SWF written in AS3.

I expect, you wrote your Flash8-Code in AS2 and wrote your Flex-Code in AS3. So your question sond like in other words: Can i load a AS3-SWF from a AS2-SWF. So the answer is no.

BR Frank