No 'Access-Control-Allow-Origin' header is present on the requested resource. Originis therefore not allowed access
Access to XMLHttpRequest at 'file:xxxxx' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
这2个错误只要你放弃使用xhr模式加载,也就是new createjs.LoadQueue(false);括号里面的参数传false就行了,如果一定要用xhr模式加载,那就只能需要服务器允许才可以跨域的,也就是需要你们后端设置。
但是声音加载默认就是需要用XHR,用an做项目的人很多都需要本地打开,那么这个坑必踩,解决办法:
createjs.Sound.registerPlugins([createjs.HTMLAudioPlugin]);//切换播放插件
loader.installPlugin(createjs.Sound);//如果是an这句是默认导出的