开发者

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 Fl开发者_如何学运维ex, 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 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜