私はこのコードを使用しようとしたが、それは動作しません:
var File1:File = File.applicationDirectory.resolvePath('APPAR-NC.exe');
if (File1.exists)
{
trace("The file exists.");
}
else
{
trace("The file does not exists.")
};
私はこのコードを使用しようとしたが、それは動作しません:
var File1:File = File.applicationDirectory.resolvePath('APPAR-NC.exe');
if (File1.exists)
{
trace("The file exists.");
}
else
{
trace("The file does not exists.")
};
あなたのコードでほんの少しの変化。
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.")
};
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
私はドキュメンテーションを見ましたが、コードを書くことができればそれが良かったです。 –
このコードのどの部分が間違っていますか? –
「動作しません」と定義します。間違ったケースを追跡していますか?それとも、他のトレースが正常に動作している間にトレースしないのですか? – Organis
問題を明確に定義し、努力と試行を提示し、失敗/結果を提示してください。だから私たちは何が問題であり、いくつかの解決策を提示する考えを持つことができます。 – coner