Air for android ignores external swf files

后端 未结 1 691
名媛妹妹
名媛妹妹 2021-01-29 00:02

I am working on some app that loads external swfs from the application directory the problem is that some swf files get loaded correctly and others give ioerror url not found

相关标签:
1条回答
  • 2021-01-29 00:45

    Firstly, whenever you load something, listen for the appropriate error events so you know what's going on:

    loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
    

    When using mobile, you should use the app:// shorthand as a reference to the application directory (which I assume is where your Game folder is. Relative paths do not usually work.

    So it should look like this:

    var arr:Array = ["app://Games/1.swf", "app://Games/2.swf"];
    

    For more information/options, you can look at my answer to this question

    0 讨论(0)
提交回复
热议问题