home *** CD-ROM | disk | FTP | other *** search
- package com.althea.client.shufflr.model
- {
- import com.althea.client.shufflr.ApplicationFacade;
- import flash.filesystem.File;
- import flash.filesystem.FileMode;
- import flash.filesystem.FileStream;
- import flash.utils.getQualifiedClassName;
- import mx.logging.ILogger;
- import mx.logging.Log;
- import org.puremvc.as3.multicore.patterns.proxy.Proxy;
-
- public class SourceSiteProxy extends Proxy
- {
- public static const NAME:String = "SourceSiteProxy";
-
- private var writeLog:ILogger;
-
- private var version:Number = 0.1;
-
- private var sourceTitle:String = "";
-
- public function SourceSiteProxy(param1:Object = null)
- {
- super(NAME,param1);
- var _loc2_:String = getQualifiedClassName(this).replace("::",".");
- this.writeLog = Log.getLogger(_loc2_);
- }
-
- public function getSourceSiteTitle() : void
- {
- var file:File = null;
- var fileStream:FileStream = null;
- var sourceSiteXML:XML = null;
- try
- {
- file = File.applicationDirectory.resolvePath("assets/xmldata/SourceSite.xml");
- if(file)
- {
- fileStream = new FileStream();
- fileStream.open(file,FileMode.READ);
- sourceSiteXML = XML(fileStream.readUTFBytes(fileStream.bytesAvailable));
- fileStream.close();
- if(sourceSiteXML)
- {
- this.sourceTitle = sourceSiteXML.child("title").children()[0].toString() as String;
- this.sendNotification(ApplicationFacade.SOURCE_SITE_TITLE,this.sourceTitle);
- }
- else
- {
- sendNotification(ApplicationFacade.SOURCE_SITE_TITLE,"");
- }
- }
- else
- {
- sendNotification(ApplicationFacade.SOURCE_SITE_TITLE,"");
- }
- }
- catch(errObj:Error)
- {
- sendNotification(ApplicationFacade.SOURCE_SITE_TITLE,"");
- }
- }
- }
- }
-
-