1 Attachment(s)
Why does it get error if i write i:int = 0; i > _drives:lengh ... Windows "C:\"
Hello guys and ladies
How do i fix for Drive C: If Adobe AIr detects to default drive C:\ or Installed Windows OS D:\ or E:\ ...
I have created code for FileUtils.as
Code:
package net.sourceskyboxer.flexos.command.utils
{
import flash.filesystem.File;
public class FileUtils
{
private static var _drive:File
private static var _drives:Array;
private static const DRIVE_C:String = "C:";
private static const DRIVE_D:String = "D:";
private static const DRIVE_E:String = "E:";
private static const DRIVE_F:String = "F:";
private static const DRIVE_G:String = "G:";
public static function get WindowsSystemDrive():File
{
_drives = File.getRootDirectories();
var i:int = 0; i < _drives.length;
if(_drives[i] == _drive.getDirectoryListing())
{
if(_drives[i].name == DRIVE_C)
{
_drive = _drives[i].esolvePath(DRIVE_C);
}
}
return _drive;
}
}
}
And i try from code - but it does not work. Why do i not get C:\ If i have installed Windows in Drive C:\.
Attachment 75357
Adobe Air Application got error:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at net.sourceskyboxer.flexos.command.utils::FileUtils$/get WindowsSystemDrive()[C:\Users\Joe\Adobe Flash Builder 4.6\FlexOS Command\src\net\sourceskyboxer\flexos\command\utils\FileUtils.as:22]
at fxCommand/onCreationCompleteHandler()[C:\Users\Joe\Adobe Flash Builder 4.6\FlexOS Command\src\fxCommand.mxml:27]
at fxCommand/___fxCommand_WindowedApplication1_creationComplete()[C:\Users\Joe\Adobe Flash Builder 4.6\FlexOS Command\src\fxCommand.mxml:5]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[/Users/erik/Documents/ApacheFlex/git/flex-sdk_RC2/flex-sdk/frameworks/projects/framework/src/mx/core/UIComponent.as:13688]
at mx.core::UIComponent/set initialized()[/Users/erik/Documents/ApacheFlex/git/flex-sdk_RC2/flex-sdk/frameworks/projects/framework/src/mx/core/UIComponent.as:1839]
at mx.managers::LayoutManager/doPhasedInstantiation()[/Users/erik/Documents/ApacheFlex/git/flex-sdk_RC2/flex-sdk/frameworks/projects/framework/src/mx/managers/LayoutManager.as:850]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[/Users/erik/Documents/ApacheFlex/git/flex-sdk_RC2/flex-sdk/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1188]
How do i fix it? Please help me! Thanks I am bit mad because code was before good working than it is not working today. I don't understand. Drive C:\ if i have installed Windows in Partition "C:\".
Thanks