AS3 - URLload本地文件absoute路径路径、本地文件、URLload、absoute

2023-09-08 13:55:24 作者:软耳猫

我想打开里面的AS3本地硬盘驱动器的文件。我得到一个安全的错误与此code:

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");

是否有可能URLload硬盘驱动器上的绝对路径?

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

编辑:所以这似乎是一个沙盒问题。讨厌鬼。是否有可能通过PHP来加载本地文件,并且发送到Flash?

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

推荐答案

PHP是一种服务器端语言,所以最终的协议是HTTP。

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.

举例: http://www.mysite.com/music

然后就可以加载文件:

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

必要的:你必须创建目录乐在服务器上的Web应用程序目录和上传文件

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