var File1:File = File.applicationDirectory.resolvePath('APPAR-NC.exe');
if (File1.exists)
{
trace("The file exists.");
}
else
{
trace("The file does not exists.")
};
0
은이 코드를 사용하려했지만 작동하지 않습니다
A
답변
1
그냥 작은 변화를 코드에서.
var File1:File = File.applicationDirectory.resolvePath("APPAR-NC.exe");
if (File1.exists)
{
if(File1.isDirectory)
trace("The folder exists.");
else
trace("The file exists.");
}
else
{
trace("The file does not exists.")
};
2
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html
// The folder where your app is installed to.
File.applicationDirectory:File
// The same result as above.
new File("app://")
// The same folder as a system path string.
File.applicationDirectory.nativePath:String
// Returns true if file/folder, represented by the File object, exists.
File.exists:Boolean
// Returns true if the path, represented by the File object, is a folder rather than a file.
File.isDirectory:Boolean
+0
설명서를 보았지만 코드를 작성할 수 있다면 더 낫습니다. –
이 코드의 어떤 부분이 잘못되었습니다!? –
"작동하지 않음"을 정의하십시오. 그것은 잘못된 경우를 추적합니까? 아니면 다른 흔적이 잘 작동하는 동안 전혀 추적하지 않습니까? – Organis
문제를 명확하게 정의하고 노력과 시도를 제시하고 실패/결과를 제시하십시오. 그래서 우리는 문제가 무엇인지 생각해보고 몇 가지 해결책을 제시 할 수 있습니다. – coner