Skip to content

Commit

Permalink
- Replaced URLLoader with simple File read utility
Browse files Browse the repository at this point in the history
- Project configuration updates (reference Moonshine-IDE/Moonshine-IDE#449)
  • Loading branch information
rat-moonshine committed Feb 26, 2019
1 parent 2231143 commit f9346fb
Show file tree
Hide file tree
Showing 7 changed files with 270 additions and 153 deletions.
1 change: 1 addition & 0 deletions InstallerSharedCore/.actionScriptProperties
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
<buildCSSFiles/>
<flashCatalyst validateFlashCatalystCompatibility="false"/>
</actionScriptProperties>

137 changes: 0 additions & 137 deletions InstallerSharedCore/src/actionScripts/business/DataAgent.as

This file was deleted.

16 changes: 10 additions & 6 deletions InstallerSharedCore/src/actionScripts/managers/StartupHelper.as
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package actionScripts.managers
import flash.events.EventDispatcher;
import flash.filesystem.File;

import actionScripts.business.DataAgent;
import actionScripts.events.HelperEvent;
import actionScripts.utils.FileUtils;
import actionScripts.utils.Parser;
import actionScripts.valueObjects.HelperConstants;

Expand All @@ -27,25 +27,29 @@ package actionScripts.managers
else
{
// TODO: need to decide on download directory
trace(File.userDirectory.nativePath);
}
}

public function loadMoonshineConfig():void
{
new DataAgent(File.applicationDirectory.resolvePath("/helperResources/data/moonshineHelperConfig.xml").nativePath, onMoonshineConfigLoaded, onMoonshineConfigError);
var configFile:File = HelperConstants.IS_MACOS ?
File.applicationDirectory.resolvePath("/helperResources/data/moonshineHelperConfig.xml") :
new File(File.applicationDirectory.nativePath + "/helperResources/data/moonshineHelperConfig.xml");
FileUtils.readFromFileAsync(configFile, FileUtils.DATA_FORMAT_STRING, onMoonshineConfigLoaded, onMoonshineConfigError);
}

protected function onMoonshineConfigLoaded(message:String=null, ...args):void
protected function onMoonshineConfigLoaded(value:Object):void
{
var config:XML = XML(args[0]);
var config:XML = new XML(value);
if (config) Parser.parseHelperConfig(config);

dispatchEvent(new HelperEvent(EVENT_CONFIG_LOADED));
}

protected function onMoonshineConfigError(errorMessage:String=null, ...args):void
protected function onMoonshineConfigError(value:String):void
{
dispatchEvent(new HelperEvent(EVENT_CONFIG_ERROR, errorMessage));
dispatchEvent(new HelperEvent(EVENT_CONFIG_ERROR, value));
}
}
}
Loading

0 comments on commit f9346fb

Please sign in to comment.