Changeset 4190

Show
Ignore:
Timestamp:
05/26/06 15:10:40 (2 years ago)
Author:
BradNeuberg
Message:

We now load flash resources relative to dojo path, rather than hard code to ../..

Location:
trunk
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/flash.js

    r4083 r4190  
    380380         //dojo.debug("installing"); 
    381381         if(dojo.flash._installingListeners.length > 0){ 
    382                         for(var i = 0;i < dojo.flash._installingListeners.length; i++){ 
     382                        for(var i = 0; i < dojo.flash._installingListeners.length; i++){ 
    383383                                dojo.flash._installingListeners[i].call(null); 
    384384                        } 
     
    667667                }else{ // Flash 8 
    668668                        swfloc = dojo.flash.flash8_version; 
    669                         var swflocObject = swfloc, swflocEmbed = swfloc; 
     669                        var swflocObject = swfloc; 
     670                        var swflocEmbed = swfloc; 
     671                        var dojoPath = djConfig.baseRelativePath; 
    670672                        if(doExpressInstall){ 
    671673                                // the location to redirect to after installing 
     
    675677                                swflocObject += "?MMredirectURL=" + redirectURL 
    676678                                                + "&MMplayerType=ActiveX" 
    677                                                 + "&MMdoctitle="+docTitle; 
    678                                 swflocEmbed += "?MMredirectURL=" + redirectURL + "&MMplayerType=PlugIn"; 
     679                                                + "&MMdoctitle=" + docTitle 
     680                                                                + "&baseRelativePath=" + escape(dojoPath); 
     681                                swflocEmbed += "?MMredirectURL=" + redirectURL  
     682                                                                + "&MMplayerType=PlugIn" 
     683                                                                + "&baseRelativePath=" + escape(dojoPath); 
    679684                        } 
    680685                         
     
    700705                                  + 'align="middle" ' 
    701706                                  + 'allowScriptAccess="sameDomain" ' 
    702                                   + 'type="application/x-shockwave-flash" ' 
     707                                  + 'type="application/x-shockwave-flash" '+ "&baseRelativePath=" + escape(dojoPath); 
    703708                                  + 'pluginspage="http://www.macromedia.com/go/getflashplayer" />' 
    704709                                + '</object>'; 
  • trunk/src/flash/flash6/DojoExternalInterface.as

    r3529 r4190  
    88class DojoExternalInterface{ 
    99        public static var available:Boolean; 
     10        public static var dojoPath = ""; 
     11         
    1012        public static var _fscommandReady = false; 
    1113        public static var _callbacks = new Array(); 
     
    1517                // FIXME: Set available variable by testing for capabilities 
    1618                DojoExternalInterface.available = true; 
     19                 
     20                // extract the dojo base path 
     21                DojoExternalInterface.dojoPath = DojoExternalInterface.getDojoPath(); 
     22                //getURL("javascript:dojo.debug('FLASH:dojoPath="+DojoExternalInterface.dojoPath+"')"); 
    1723                 
    1824                // Sometimes, on IE, the fscommand infrastructure can take a few hundred 
     
    176182        public static function _initializeFlashRunner(){ 
    177183                // figure out where our Flash movie is 
    178                 var swfLoc = "../.."; 
    179                 if(swfLoc.charAt(swfLoc.length - 1) != '/'){ 
    180                         swfLoc = swfLoc + "/"; 
    181                 } 
    182                 swfLoc = swfLoc + "flash6_gateway.swf"; 
     184                var swfLoc = DojoExternalInterface.dojoPath + "flash6_gateway.swf"; 
    183185                 
    184186                // load our gateway helper file 
     
    187189                _root._flashRunner.loadMovie(swfLoc); 
    188190        } 
     191         
     192        private static function getDojoPath(){ 
     193                var url = _root._url; 
     194                var start = url.indexOf("baseRelativePath=") + "baseRelativePath=".length; 
     195                var path = url.substring(start); 
     196                var end = path.indexOf("&"); 
     197                if(end != -1){ 
     198                        path = path.substring(0, end); 
     199                } 
     200                return path; 
     201        } 
    189202} 
    190203 
  • trunk/src/flash/flash8/DojoExternalInterface.as

    r3626 r4190  
    1818class DojoExternalInterface{ 
    1919        public static var available:Boolean; 
     20        public static var dojoPath = ""; 
    2021         
    2122        private static var flashMethods:Array = new Array(); 
     
    2526         
    2627        public static function initialize(){ 
     28                // extract the dojo base path 
     29                DojoExternalInterface.dojoPath = DojoExternalInterface.getDojoPath(); 
     30                 
    2731                // see if we need to do an express install 
    2832                var install:ExpressInstall = new ExpressInstall(); 
     
    205209                return inputStr; 
    206210        } 
     211         
     212        private static function getDojoPath(){ 
     213                var url = _root._url; 
     214                var start = url.indexOf("baseRelativePath=") + "baseRelativePath=".length; 
     215                var path = url.substring(start); 
     216                var end = path.indexOf("&"); 
     217                if(end != -1){ 
     218                        path = path.substring(0, end); 
     219                } 
     220                return path; 
     221        } 
    207222} 
    208223 
  • trunk/src/storage/Storage.as

    r3639 r4190  
    99         
    1010        public function Storage(){ 
     11                //getURL("javascript:dojo.debug('FLASH:Storage constructor')"); 
    1112                DojoExternalInterface.initialize(); 
    1213                DojoExternalInterface.addCallback("put", this, put); 
     
    2122                // access so it is in the cache 
    2223                _root.createEmptyMovieClip("_settingsBackground", 1); 
    23                 _root._settingsBackground.loadMovie("../../storage_dialog.swf"); 
     24                _root._settingsBackground.loadMovie(DojoExternalInterface.dojoPath + "storage_dialog.swf"); 
    2425        } 
    2526 
     
    8889                // background that we can show a close button on. 
    8990                _root.createEmptyMovieClip("_settingsBackground", 1); 
    90                 _root._settingsBackground.loadMovie("../../storage_dialog.swf"); 
     91                _root._settingsBackground.loadMovie(DojoExternalInterface.dojoPath + "storage_dialog.swf"); 
    9192        } 
    9293         
     
    108109                        results.push(i);         
    109110                 
    110                 // join the keys together in a comma seperate string 
     111                // join the keys together in a comma seperated string 
    111112                results = results.join(","); 
    112113