简体   繁体   中英

Call Flex methods from swf compiled with Flash

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?

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 eg 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM