开发者

AS3 - URLload local files with absoute path

开发者 https://www.devze.com 2023-04-10 15:29 出处:网络
I am trying to open local hard drive files inside AS3.I\'m getting a security error with this code: var soundFile:URLRequest = new URLRequest(\"c:\\slushy.mp3开发者_如何学C\");

I am trying to open local hard drive files inside AS3. I'm getting a security error with this code:

var soundFile:URLRequest = new URLRequest("c:\slushy.mp3开发者_如何学C");

Is it possible to URLload an absolute path on the hard drive?

Edit: so this appears to be a sandboxing issue. Drat. Is it possible to load the local file via PHP and send to flash?


PHP is a server language, so the final protocol is http.

The you must to acces by file:/// to the local file, but if you want to share the resources over Internet, you must upload your files to folder in the root of site.

By example: http://www.mysite.com/music

Then you can load the file:

    var soundFile:URLRequest = new URLRequest("http://www.mysite.com/music/slushy.mp3");

Requisite: you must to create the directory "music" in server web application directory and upload the file.

0

精彩评论

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