1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
package
{
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
public class FileTestProxy extends EventDispatcher
{
public static var EVENT_FILE_NOT_FOUND : String = 'EVENT_FILE_NOT_FOUND';
public function FileTestProxy (target:IEventDispatcher=null)
{
super(target);
}
public function execute ( pFilename : String ) : void
{
var f:File = File.applicationStorageDirectory.resolvePath(pFilename);
if(!f.exists)
{
// Déclenche ton évènement
dispatchEvent( new Event ( EVENT_FILE_NOT_FOUND ));
}
}
}
} |