Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 如何在AIR应用程序中指向as3中桌面目录上的文件_Actionscript 3_Air - Fatal编程技术网

Actionscript 3 如何在AIR应用程序中指向as3中桌面目录上的文件

Actionscript 3 如何在AIR应用程序中指向as3中桌面目录上的文件,actionscript-3,air,Actionscript 3,Air,我目前正在使用此功能从我的AIR desktop程序中的桌面文件夹中成功加载(并播放)mp3: soundBG2.load(new URLRequest("C:/Users/User/Desktop/music/mySong.mp3")); 它工作得很好,但是我不想使用显式路径。我想使用类似于: soundBG2.load(new URLRequest(desktopDirectory+"/music/mySong.mp3")); …这当然不符合那里的编码方式,但我该怎么做呢 谢谢你想明白

我目前正在使用此功能从我的AIR desktop程序中的桌面文件夹中成功加载(并播放)mp3:

soundBG2.load(new URLRequest("C:/Users/User/Desktop/music/mySong.mp3"));
它工作得很好,但是我不想使用显式路径。我想使用类似于:

soundBG2.load(new URLRequest(desktopDirectory+"/music/mySong.mp3")); 
…这当然不符合那里的编码方式,但我该怎么做呢

谢谢你

想明白了:

soundBG2.load(new URLRequest(File.desktopDirectory.nativePath + "/music/mySong.mp3"));
我想出来了:

soundBG2.load(new URLRequest(File.desktopDirectory.nativePath + "/music/mySong.mp3"));