Handle VerifyError: Error #1014 when loading swfs using AS3

前端 未结 5 1650
花落未央
花落未央 2021-02-11 07:40

We are making a system that has a main swf for the application, and loads separate tools from separate swfs -- there will be versioning issues in the future since the s

5条回答
  •  無奈伤痛
    2021-02-11 08:08

    I think there is a way to workaround this issue.

    1. load the swf using a URLLoader or URLStream into a ByteArray.
    2. Use any open source library for parsing SWF binary like this or this.
    3. check if it verifies that the whole byte array represents valid SWF file.
    4. If above test succeeds then load this ByteArray into loader using loadBytes method.
    5. Else show user that this is not working.

    Disclaimer: A binary file can be a valid SWF still might not be render-able, but with this you can discard all the invalid SWFs or any other formats whose extension are changed to swf.

提交回复
热议问题