Changeset 1284

Show
Ignore:
Timestamp:
03/07/10 18:18:37 (5 months ago)
Author:
dreisch
Message:

-fixed #1110

Location:
flash_player/trunk/src/org/korsakow/player
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • flash_player/trunk/src/org/korsakow/player/ApplicationBase.as

    r1281 r1284  
    3232                protected var Splash:Class; 
    3333                 
    34                 public static const DefaultProjectPath:String = "project.xml"; 
     34                public static const DefaultProjectFile:String = "project.xml"; 
    3535                protected var domain:Domain; 
    3636                protected var _project:Project; 
    37                 protected var _projectPath:String; 
     37                protected var _basePath:String; 
    3838                protected var fontManager:FontManager; 
    3939                protected var soundManager:SoundManager; 
     
    6161                                } 
    6262                        } 
     63                        if (_config.has(ConfigKeys.BASE_PATH)) { 
     64                                _basePath = _config.get(ConfigKeys.BASE_PATH); 
     65                                if (_basePath.charAt(_basePath.length-1) != '/') 
     66                                        _basePath += '/'; 
     67                        } else 
     68                                _basePath = './'; 
     69                        Debug.log("BasePath="+_basePath); 
    6370                        initInputMap(); 
    6471                         
     
    7279                        return _project; 
    7380                } 
    74                 public function get projectPath():String 
    75                 { 
    76                         return _projectPath; 
     81                public function get basePath():String 
     82                { 
     83                        return _basePath; 
    7784                } 
    7885                /** 
     
    169176                { 
    170177                        stopApplication(); 
    171                         loadProject(_projectPath); 
    172                 } 
    173                 public function loadProject(dataPath:String=null):void 
    174                 { 
    175                         if (dataPath==null) { 
    176                                 if (_config.has(ConfigKeys.DATA_PATH)) 
    177                                         dataPath = _config.getString(ConfigKeys.DATA_PATH); 
    178                                 else 
    179                                         dataPath = DefaultProjectPath; 
    180                         } 
    181          
     178                        loadDefaultProject(); 
     179                } 
     180                public function loadDefaultProject():void 
     181                { 
     182                        loadProject(_basePath + DefaultProjectFile); 
     183                } 
     184                public function loadProject(dataPath:String):void 
     185                { 
    182186                        fontManager = new FontManager(); 
    183187                        soundManager = new SoundManager(); 
    184188                         
    185                         _projectPath = dataPath; 
    186189                        domain = new Domain(); 
    187190                        domain.addEventListener(Event.COMPLETE, onDomainLoadComplete); 
  • flash_player/trunk/src/org/korsakow/player/ConfigKeys.as

    r1055 r1284  
    44        { 
    55                public static const REQUIRE_VERSION:String = "requireVersion"; 
    6                 public static const DATA_PATH:String = "dataPath"; 
     6                public static const BASE_PATH:String = "basePath"; 
    77        } 
    88} 
  • flash_player/trunk/src/org/korsakow/player/Domain.as

    r1188 r1284  
    139139                try { 
    140140                        var request:URLRequest = new URLRequest(source); 
    141                         Debug.log("Domain.load", request.url); 
     141                        Debug.log("Domain.load", ""+request.url); 
    142142                        domainLoader.load(request); 
    143143                } catch (e:*) { 
  • flash_player/trunk/src/org/korsakow/player/EmbedApplication.as

    r1281 r1284  
    3535                        super(view); 
    3636//                      AssetUtil.addAssetLoadListener(new Splash(), ShowSplashScreenAction.hook(this, loadProject)); 
    37                         loadProject(); 
     37                        loadDefaultProject(); 
    3838                } 
    3939                override public function startApplication():void 
  • flash_player/trunk/src/org/korsakow/player/IKorsakowApplication.as

    r1151 r1284  
    1212                function get inputMap():InputMap; 
    1313                function get project():IProject; 
    14                 function get projectPath():String; 
     14                function get basePath():String; 
    1515                function startApplication():void; 
    1616                function stopApplication():void; 
    17                 function loadProject(path:String=null):void; 
     17                function loadProject(path:String):void; 
    1818                function reloadProject():void; 
    1919                function showErrorDialog(message:String, title:String='Error'):void; 
  • flash_player/trunk/src/org/korsakow/player/engine/Engine.as

    r1276 r1284  
    594594                public function resolveFilename(filename:String):String 
    595595                { 
    596                         return filename; 
     596                        return _app.basePath + filename; 
    597597                } 
    598598