[Zmx-cvs-commit] zmx XMLRPCHelper.as,1.1.2.3,1.1.2.4 ZMX_ClipClass.as,1.5,1.5.2.1 ZMX_Lib.as,1.1.2.2
Brought to you by:
sspickle
|
From: Steve S. <ssp...@us...> - 2006-02-20 14:40:31
|
Update of /cvsroot/zmx/zmx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14060 Modified Files: Tag: ActionScript_2-0_conversion XMLRPCHelper.as ZMX_ClipClass.as ZMX_Lib.as Log Message: safety... Index: ZMX_Lib.as =================================================================== RCS file: /cvsroot/zmx/zmx/Attic/ZMX_Lib.as,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** ZMX_Lib.as 18 Apr 2004 13:26:18 -0000 1.1.2.2 --- ZMX_Lib.as 20 Feb 2006 14:40:24 -0000 1.1.2.3 *************** *** 2,5 **** --- 2,13 ---- class zmx.ZMX_Lib { + static function checkDef( x, defX ) { + // shorthand.. + // if x is null, return defX, otherwise, return x + // + return x == null ? defX : x; + + } + static function serializeObject( anObject, level, limit ) { Index: ZMX_ClipClass.as =================================================================== RCS file: /cvsroot/zmx/zmx/ZMX_ClipClass.as,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** ZMX_ClipClass.as 4 Dec 2003 22:22:33 -0000 1.5 --- ZMX_ClipClass.as 20 Feb 2006 14:40:24 -0000 1.5.2.1 *************** *** 13,466 **** */ ! c = _global.ZMX_ClipClass = function() { ! if (this._name != null) { ! this.constr(); ! } ! }; ! p = c.prototype = new MovieClip(); ! p.constr = function() { ! // constr is called during instance construction. ! // ! this.dynamicControls = []; ! this.msgLevel = 2000; ! } ! ! p.init = function( config ) { ! // ! // init is called when the object is "loaded" in the flash sense. ! // ! // ! // clear out any existing dynamically loaded controls.. ! // ! for (var i=0; i<this.dynamicControls.length; i++) { ! this.dynamicControls[i].removeMovieClip(); } ! this.dynamicControls = []; ! var cdef = _global.checkDef; ! ! this.controlLevel = cdef(config.controlLevel,1000); ! this.configURL = cdef(config.configURL,'zapp_get_object_info'); ! this.configArgs = cdef(config.configArgs,[]); ! if (config.IXMLConfig != null) { ! this.ixml = new _global.InstantXMLHelper( this, config.IXMLConfig ); } ! this.xmlCaller = new _global.XMLRPCHelper( this ); ! }; ! ! p.getClipKey = function( ) { ! // ! // calculate key to lookup config url from server... ! // ! return this._url.split('/').slice(-1)[0]; ! } ! ! p.getVersion = function() { ! var revRepr = 'unversioned'; ! if (this.revString != null) { ! var fullRev = this.revString; ! var frStart = 11; ! var frEnd = fullRev.length - 1; ! revRepr = "v-" + fullRev.slice(frStart, frEnd); } - return this.getClipKey() + ": " + revRepr; - } - - p.xmlConfigSuccess = function(result) { - this.initUI(result); ! if (this.doEnterKey != null) { ! this.onKeyDown = this.ZMX_Clip_onKeyDown; ! Key.addListener(this); } ! } ! ! p.onUnload = function () { ! if (this.doEnterKey != null) { ! Key.removeListener( this ); } ! } ! ! p.ZMX_Clip_onKeyDown = function () { ! if (Key.getCode() == KEY.ENTER) { ! this.doEnterKey(); } - } - - p.xmlConfigFailure = function() { - _global.gTrace("ack. failed to get XML"); - } - - p.onLoad = function ( ) { - - _global.gTrace("using XMLRPC to load clip"); ! this.xmlCaller.callMethod(this.configURL, this.configArgs, null, this, 'xmlConfigSuccess', 'xmlConfigFailure'); ! } ! ! p.callXML = function( cmdURL, args) { ! this.xmlCaller.callMethod( cmdURL, args, null, this, 'xmlResponse', 'xmlFailed'); ! } ! ! p.doCallXML = function ( comp ) { ! this.callXML( comp.cmdURL, this.getCommandArgs(comp)); ! } ! ! p.doCallInstantXML = function( comp ) { ! this.ixml.send(this.getCommandArgs(comp), comp.method); ! } ! p.xmlResponse = function( result ) { ! _global.gTrace("XML Call result: " + _global.serializeObject( result )); ! } ! ! p.xmlFailed = function( result ) { ! _global.gTrace("XML Failed! -> " + result); ! } ! ! ! p.getCompProxy = function( comp ) { ! // ! // extract useful information from a component. ! // ! var attr; ! var val; ! var proxy = {}; ! ! var send_attrs = comp.send_attrs; ! if (send_attrs != null) { ! if (typeof(send_attrs) == 'string') { ! send_attrs = send_attrs.split(':'); ! } ! for (var i=0; i<send_attrs.length; i++) { ! attr = send_attrs[i]; ! val = comp[attr]; ! if (val == null) { ! val = this.getFieldValue(attr); ! } ! proxy[attr] = val; ! } } ! if (comp.comp_ValueAttribute != null) { ! proxy[comp.comp_ValueAttribute] = comp.getValue(); } ! ! return proxy; ! } ! ! p.setupControls = function ( controlData, currX, currY ) { ! ! var cdef = _global.checkDef; ! ! var deltaX = null; ! if (controlData.deltaX != null) { ! if (typeof(controlData.deltaX) == 'string') { ! deltaX = parseFloat(controlData.deltaX); } ! else ! { ! deltaX = controlData.deltaX; } } ! ! var deltaY = null; ! if (controlData.deltaY != null) { ! if (typeof(controlData.deltaY) == 'string') { ! deltaY = parseFloat(controlData.deltaY); } ! else ! { ! deltaY = controlData.deltaY; } } ! ! var control; // alloc vars for the control and the point.. ! var point; // current point.. ! ! if ( controlData.control.length != null) { ! controls=controlData.control; ! for ( var i=0; i<controls.length; i++) { ! var control = controls[i]; ! ! if (i==0) { ! point = {_x:cdef(control._x,currX), _y:cdef(control._y,currY)}; } else { ! point = {_x:cdef(control._x,point._x), _y:cdef(control._y,point._y)}; } ! point = this.setupControl(control, point, deltaX, deltaY); } - } - } - - p.setupControl = function( control, point, deltaX, deltaY ) { - - var init = {_x:point._x, _y:point._y}; - var controlName = control.name; - var controlClip; ! if (controlName == null) { ! if (control.url != null) { ! controlClip = this.createEmptyMovieClip(controlName+this.controlLevel, this.controlLevel++); ! controlClip._x = init._x; ! controlClip._y = init._y; ! controlClip.loadMovie( control.url ); } else { return point; } ! } else { ! controlClip = this.attachMovie(controlName, controlName+this.controlLevel, this.controlLevel++, init); ! } ! ! if (controlClip != null) { ! this.dynamicControls.push(controlClip); ! } ! else { ! return point; ! } ! ! this.setupComponent( controlClip, control ); ! if (controlClip.needsChecks != null) { ! controlClip.setEnabled( false ); ! } ! if (deltaX != null) { ! point._x += controlClip.width + deltaX; ! } ! if (deltaY != null) { ! point._y += controlClip.height + deltaY; } - - return point; - } - - p.setupComponent = function( componentClip, componentInits ) { - - // - // Setup a component movieclip (componentClip) using - // information in structure (componentInits ) - // ! // if component has 'setXXX' method, then use structure's ! // 'XXX' attribute as argument. e.g., if structure has ! // {CloseHandler:'doLoadScreen'}, then call ! // component.setCloseHandler( structure.CloseHandler ); ! // ! // if structure has 'item' attribute, assume it's a list of ! // structures with 'label' and 'data' values... ! // ! var width = null; ! var height = null; ! ! for (var attr in componentInits) { ! ! if (attr == 'width') { ! width = parseInt(componentInits.width); } ! else if (attr == 'height') { ! height = parseInt(componentInits.height); } ! else if (attr != 'item') { ! if (componentClip['set' + attr] != null) { ! componentClip['set' + attr](componentInits[attr]); ! }else if (componentClip._name.slice(0,5) != 'comp_') { ! componentClip[attr] = componentInits[attr]; } } } ! ! if (width != null) { ! if (height != null) { ! componentClip.setSize(width, height); } ! else { ! componentClip.setSize(width, controlClip.height); } ! } ! ! if (componentInits.item != null) { ! for (var j=0; j<componentInits.item.length; j++) { ! var anItem = componentInits.item[j]; ! componentClip.addItem(anItem.label, anItem.data); } } - } ! p.setupTable = function( dt, tableData ) { ! ! var rowData = tableData.rows; ! ! var i,j; ! var columnInfo; // info about a column. ! var column; // the colum itself. ! var row; // a rows worth of row data.. ! ! var cdef = _global.checkDef; ! var columnNames = []; ! ! dt.removeAllItems(); ! dt.removeAllColumns(); ! dt.setSelectMultiple( cdef(tableData.selectMultiple, true)); ! dt.alternateRowColors(cdef(tableData.rowColor1,0x9999FF), ! cdef(tableData.rowColor2,0xCCCCFF)); ! ! for( i=0; i<tableData.columnInits.length; i++) { ! if (!cdef(tableData.columnInits[i].hidden,false)) { ! columnNames.push(tableData.columnInits[i].name); ! } ! } ! ! dt.setColumns.apply( dt, columnNames); ! ! var defPWidth = 100.0/(columnNames.length); ! for( i=0; i<tableData.columnInits.length; i++) { ! columnInfo = tableData.columnInits[i]; ! column = dt.getColumnAt(i); ! if (!cdef(columnInfo.hidden,false)) { // check that this is not a hidden column ! column.setHeader(cdef(columnInfo.label, columnInfo.name)); ! column.setWidth( dt.width * cdef(columnInfo.percentWidth, defPWidth)/100.0); ! if (columnInfo.cellSymbol != null) { ! column.setCellSymbol( columnInfo.cellSymbol); } } - } - - if (rowData != null) { - dt.setDataProvider( rowData ); - } ! dt.setChangeHandler(cdef(tableData.changeHandler, 'tableChanged')); ! dt.updateControl(); ! } ! ! p.getCommandProxy = function(comp) { ! // ! // get proxy for clip/component ! // ! ! var proxy = {}; ! var attr; ! var val; ! var send_attrs = comp.send_attrs; ! if (send_attrs != null) { ! if (typeof(send_attrs) == 'string') { ! send_attrs = send_attrs.split(':'); ! } ! for (var i=0; i<send_attrs.length; i++) { ! attr = send_attrs[i]; ! val = comp[attr]; ! if (val == null) { ! val = this.getFieldValue(attr); } - proxy[ attr ] = val; } } - - return proxy; - } ! p.getCommandArgs = function(comp) { ! // ! // get proxy for clip/component ! // ! ! var args = []; ! var attr; ! var val; ! var send_attrs = comp.send_attrs; ! if (send_attrs != null) { ! if (typeof(send_attrs) == 'string') { ! send_attrs = send_attrs.split(':'); } ! for (var i=0; i<send_attrs.length; i++) { ! attr = send_attrs[i]; ! val = comp[attr]; ! if (val == null) { ! val = this.getFieldValue(attr); } - args.push(val); } } ! ! return args; ! } ! ! p.getFieldValue = function ( attr, defaultValue) { ! // ! // take a stab at getting a sensible value for a field.. ! // ! ! if (defaultValue == null) { ! defaultValue = ''; ! } ! ! var val = defaultValue; ! ! var field=this[attr]; ! ! if (field != null) { ! if (field.getValue != null) { ! val = field.getValue(); ! } ! else if (field.text != null) { ! val =field.text; ! } ! else if (field.html != null) { ! val=field.html; ! } ! else { ! val = field; ! } } - return val; - } - - - p.clipWindow = function( msgInfo) { - - var ckd = _global.checkDef; - - var props = {resizable:ckd(msgInfo.resizable,false), - isScrolling:ckd(msgInfo.isScrolling,false), - scrollContent:ckd(msgInfo.name, 'defaultScreenWindow'), - paneTitle:ckd(msgInfo.title, "Information"), _x:this._width/2, _y:this._height/2, - msgInfo:msgInfo}; - - var scrWindow = this.attachMovie("FDraggablePaneSymbol", 'FDraggablePaneSymbol' + this.msgLevel, this.msgLevel++, props ); ! return scrWindow; ! } ! ! p.clipMessage = function( msgInfo ) { ! ! var msgBox = this.attachMovie("FAdvancedMessageBoxSymbol", "FAdvancedMessageBoxSymbol" + this.msgLevel, this.msgLevel++, {_x:this._width/2, _y:this._height/2}); ! if (msgBox == null) { ! msgBox = this.attachMovie("FMessageBoxSymbol", "FMessageBoxSymbol" + this.msgLevel, this.msgLevel++, {_x:this._width/2, _y:this._height/2}); ! } ! this.setupComponent( msgBox, msgInfo); ! msgBox.setButtons([msgInfo.buttonLabel]); ! msgBox.setMessage(msgInfo.message); ! ! return msgBox; } - - delete p; - delete c; --- 13,472 ---- */ ! import zmx.* ! class zmx.ZMX_ClipClass extends MovieClip { ! var dynamicControls; ! var msgLevel; ! var controlLevel; ! var configURL; ! var configArgs; ! function ZMX_ClipClass () { ! if (this._name != null) { ! this.constr(); ! } ! }; ! ! function constr() { ! // constr is called during instance construction. ! // ! this.dynamicControls = []; ! this.msgLevel = 2000; } ! function init( config ) { ! // ! // init is called when the object is "loaded" in the flash sense. ! // ! // ! // clear out any existing dynamically loaded controls.. ! // ! ! for (var i=0; i<this.dynamicControls.length; i++) { ! this.dynamicControls[i].removeMovieClip(); ! } ! ! this.dynamicControls = []; ! ! var cdef = zmx.ZMX_LIB.checkDef; ! ! this.controlLevel = cdef(config.controlLevel,1000); ! this.configURL = cdef(config.configURL,'zapp_get_object_info'); ! this.configArgs = cdef(config.configArgs,[]); ! ! if (config.IXMLConfig != null) { ! this.ixml = new zmx.InstantXMLHelper( this, config.IXMLConfig ); ! } ! ! this.xmlCaller = new zmx.XMLRPCHelper( this ); ! }; ! function getClipKey( ) { ! // ! // calculate key to lookup config url from server... ! // ! return this._url.split('/').slice(-1)[0]; ! } ! function getVersion() { ! var revRepr = 'unversioned'; ! if (this.revString != null) { ! var fullRev = this.revString; ! var frStart = 11; ! var frEnd = fullRev.length - 1; ! revRepr = "v-" + fullRev.slice(frStart, frEnd); ! } ! return this.getClipKey() + ": " + revRepr; } ! function xmlConfigSuccess(result) { ! this.initUI(result); ! ! if (this.doEnterKey != null) { ! this.onKeyDown = this.ZMX_Clip_onKeyDown; ! Key.addListener(this); ! } } ! function onUnload() { ! if (this.doEnterKey != null) { ! Key.removeListener( this ); ! } } ! ! function ZMX_Clip_onKeyDown() { ! if (Key.getCode() == KEY.ENTER) { ! this.doEnterKey(); ! } } ! ! function xmlConfigFailure() { ! _global.gTrace("ack. failed to get XML"); } ! function onLoad( ) { ! _global.gTrace("using XMLRPC to load clip"); ! ! this.xmlCaller.callMethod(this.configURL, this.configArgs, null, this, 'xmlConfigSuccess', 'xmlConfigFailure'); ! } ! function callXML( cmdURL, args) { ! this.xmlCaller.callMethod( cmdURL, args, null, this, 'xmlResponse', 'xmlFailed'); ! } ! ! function doCallXML( comp ) { ! this.callXML( comp.cmdURL, this.getCommandArgs(comp)); ! } ! ! function doCallInstantXML( comp ) { ! this.ixml.send(this.getCommandArgs(comp), comp.method); ! } ! function xmlResponse( result ) { ! _global.gTrace("XML Call result: " + _global.serializeObject( result )); } ! function xmlFailed( result ) { ! _global.gTrace("XML Failed! -> " + result); } ! ! ! function getCompProxy( comp ) { ! // ! // extract useful information from a component. ! // ! var attr; ! var val; ! var proxy = {}; ! ! var send_attrs = comp.send_attrs; ! ! if (send_attrs != null) { ! if (typeof(send_attrs) == 'string') { ! send_attrs = send_attrs.split(':'); ! } ! ! for (var i=0; i<send_attrs.length; i++) { ! attr = send_attrs[i]; ! val = comp[attr]; ! if (val == null) { ! val = this.getFieldValue(attr); ! } ! proxy[attr] = val; ! } } ! ! if (comp.comp_ValueAttribute != null) { ! proxy[comp.comp_ValueAttribute] = comp.getValue(); } + + return proxy; } ! ! function setupControls( controlData, currX, currY ) { ! ! var cdef = _global.checkDef; ! ! var deltaX = null; ! if (controlData.deltaX != null) { ! if (typeof(controlData.deltaX) == 'string') { ! deltaX = parseFloat(controlData.deltaX); ! } ! else ! { ! deltaX = controlData.deltaX; ! } } ! ! var deltaY = null; ! if (controlData.deltaY != null) { ! if (typeof(controlData.deltaY) == 'string') { ! deltaY = parseFloat(controlData.deltaY); ! } ! else ! { ! deltaY = controlData.deltaY; ! } ! } ! ! var control; // alloc vars for the control and the point.. ! var point; // current point.. ! ! if ( controlData.control.length != null) { ! controls=controlData.control; ! for ( var i=0; i<controls.length; i++) { ! var control = controls[i]; ! ! if (i==0) { ! point = {_x:cdef(control._x,currX), _y:cdef(control._y,currY)}; ! } ! else { ! point = {_x:cdef(control._x,point._x), _y:cdef(control._y,point._y)}; ! } ! point = this.setupControl(control, point, deltaX, deltaY); ! } } } ! ! function setupControl( control, point, deltaX, deltaY ) { ! ! var init = {_x:point._x, _y:point._y}; ! var controlName = control.name; ! var controlClip; ! ! if (controlName == null) { ! if (control.url != null) { ! controlClip = this.createEmptyMovieClip(controlName+this.controlLevel, this.controlLevel++); ! controlClip._x = init._x; ! controlClip._y = init._y; ! controlClip.loadMovie( control.url ); } else { ! return point; } ! } else { ! controlClip = this.attachMovie(controlName, controlName+this.controlLevel, this.controlLevel++, init); } ! if (controlClip != null) { ! this.dynamicControls.push(controlClip); } else { return point; } ! ! this.setupComponent( controlClip, control ); ! ! if (controlClip.needsChecks != null) { ! controlClip.setEnabled( false ); ! } ! if (deltaX != null) { ! point._x += controlClip.width + deltaX; ! } ! if (deltaY != null) { ! point._y += controlClip.height + deltaY; ! } ! return point; } ! function setupComponent( componentClip, componentInits ) { + // + // Setup a component movieclip (componentClip) using + // information in structure (componentInits ) + // + + // if component has 'setXXX' method, then use structure's + // 'XXX' attribute as argument. e.g., if structure has + // {CloseHandler:'doLoadScreen'}, then call + // component.setCloseHandler( structure.CloseHandler ); + // + // if structure has 'item' attribute, assume it's a list of + // structures with 'label' and 'data' values... + // + + + var width = null; + var height = null; ! for (var attr in componentInits) { ! ! if (attr == 'width') { ! width = parseInt(componentInits.width); ! } ! else if (attr == 'height') { ! height = parseInt(componentInits.height); ! } ! else if (attr != 'item') { ! if (componentClip['set' + attr] != null) { ! componentClip['set' + attr](componentInits[attr]); ! }else if (componentClip._name.slice(0,5) != 'comp_') { ! componentClip[attr] = componentInits[attr]; ! } ! } } ! ! if (width != null) { ! if (height != null) { ! componentClip.setSize(width, height); ! } ! else { ! componentClip.setSize(width, controlClip.height); ! } } ! ! if (componentInits.item != null) { ! for (var j=0; j<componentInits.item.length; j++) { ! var anItem = componentInits.item[j]; ! componentClip.addItem(anItem.label, anItem.data); } } } ! ! function setupTable( dt, tableData ) { ! ! var rowData = tableData.rows; ! ! var i,j; ! var columnInfo; // info about a column. ! var column; // the colum itself. ! var row; // a rows worth of row data.. ! ! var cdef = _global.checkDef; ! var columnNames = []; ! ! dt.removeAllItems(); ! dt.removeAllColumns(); ! dt.setSelectMultiple( cdef(tableData.selectMultiple, true)); ! dt.alternateRowColors(cdef(tableData.rowColor1,0x9999FF), ! cdef(tableData.rowColor2,0xCCCCFF)); ! ! for( i=0; i<tableData.columnInits.length; i++) { ! if (!cdef(tableData.columnInits[i].hidden,false)) { ! columnNames.push(tableData.columnInits[i].name); ! } } ! ! dt.setColumns.apply( dt, columnNames); ! ! var defPWidth = 100.0/(columnNames.length); ! ! for( i=0; i<tableData.columnInits.length; i++) { ! columnInfo = tableData.columnInits[i]; ! column = dt.getColumnAt(i); ! if (!cdef(columnInfo.hidden,false)) { // check that this is not a hidden column ! column.setHeader(cdef(columnInfo.label, columnInfo.name)); ! column.setWidth( dt.width * cdef(columnInfo.percentWidth, defPWidth)/100.0); ! if (columnInfo.cellSymbol != null) { ! column.setCellSymbol( columnInfo.cellSymbol); ! } ! } } ! ! if (rowData != null) { ! dt.setDataProvider( rowData ); } + + dt.setChangeHandler(cdef(tableData.changeHandler, 'tableChanged')); + dt.updateControl(); } ! function getCommandProxy(comp) { ! // ! // get proxy for clip/component ! // ! ! var proxy = {}; ! var attr; ! var val; ! var send_attrs = comp.send_attrs; ! if (send_attrs != null) { ! if (typeof(send_attrs) == 'string') { ! send_attrs = send_attrs.split(':'); ! } ! for (var i=0; i<send_attrs.length; i++) { ! attr = send_attrs[i]; ! val = comp[attr]; ! if (val == null) { ! val = this.getFieldValue(attr); ! } ! proxy[ attr ] = val; } } ! return proxy; ! } ! ! function getCommandArgs(comp) { ! // ! // get proxy for clip/component ! // ! var args = []; ! var attr; ! var val; ! var send_attrs = comp.send_attrs; ! ! if (send_attrs != null) { ! if (typeof(send_attrs) == 'string') { ! send_attrs = send_attrs.split(':'); ! } ! for (var i=0; i<send_attrs.length; i++) { ! attr = send_attrs[i]; ! val = comp[attr]; ! if (val == null) { ! val = this.getFieldValue(attr); ! } ! args.push(val); } } + + return args; } ! function getFieldValue( attr, defaultValue) { ! // ! // take a stab at getting a sensible value for a field.. ! // ! if (defaultValue == null) { ! defaultValue = ''; } ! ! var val = defaultValue; ! ! var field=this[attr]; ! ! if (field != null) { ! if (field.getValue != null) { ! val = field.getValue(); ! } ! else if (field.text != null) { ! val =field.text; ! } ! else if (field.html != null) { ! val=field.html; ! } ! else { ! val = field; } } + return val; } ! ! ! function clipWindow( msgInfo) { ! ! var ckd = _global.checkDef; ! ! var props = {resizable:ckd(msgInfo.resizable,false), ! isScrolling:ckd(msgInfo.isScrolling,false), ! scrollContent:ckd(msgInfo.name, 'defaultScreenWindow'), ! paneTitle:ckd(msgInfo.title, "Information"), _x:this._width/2, _y:this._height/2, ! msgInfo:msgInfo}; ! ! var scrWindow = this.attachMovie("FDraggablePaneSymbol", 'FDraggablePaneSymbol' + this.msgLevel, this.msgLevel++, props ); ! ! return scrWindow; } ! function clipMessage( msgInfo ) { ! var msgBox = this.attachMovie("FAdvancedMessageBoxSymbol", "FAdvancedMessageBoxSymbol" + this.msgLevel, this.msgLevel++, {_x:this._width/2, _y:this._height/2}); ! if (msgBox == null) { ! msgBox = this.attachMovie("FMessageBoxSymbol", "FMessageBoxSymbol" + this.msgLevel, this.msgLevel++, {_x:this._width/2, _y:this._height/2}); ! } ! ! this.setupComponent( msgBox, msgInfo); ! ! msgBox.setButtons([msgInfo.buttonLabel]); ! msgBox.setMessage(msgInfo.message); ! return msgBox; ! } } Index: XMLRPCHelper.as =================================================================== RCS file: /cvsroot/zmx/zmx/Attic/XMLRPCHelper.as,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** XMLRPCHelper.as 18 Apr 2004 13:26:18 -0000 1.1.2.3 --- XMLRPCHelper.as 20 Feb 2006 14:40:24 -0000 1.1.2.4 *************** *** 92,100 **** } ! if (this.config.CONTEXT_CONFIG == true) { ! ! if (this.config.configMethod == null) { ! this.config.configMethod = 'getXMLRPCConfig'; ! } // --- 92,96 ---- } ! if (this.config.configMethod != null) { // *************** *** 105,119 **** this.configProxy.controller = this; this.configProxy._url = proxy._url; ! this.configProxy.trace = proxy.trace; this.configProxy.responseSuccess = function( result ) { ! this.controller.configSuccess( result ); } this.configProxy.responseFailure = function( result ) { ! this.controller.configFailure( result ); } ! this.configHelper = new zmx.XMLRPCHelper( this.configProxy, {emulationMethod:this.config.emulationMethod}); this.configHelper.callMethod( this.config.configMethod, []); } --- 101,115 ---- this.configProxy.controller = this; this.configProxy._url = proxy._url; ! this.configProxy.trace = proxy.trace; this.configProxy.responseSuccess = function( result ) { ! this.controller.proxy.configSuccess( result ); } this.configProxy.responseFailure = function( result ) { ! this.controller.proxy.configFailure( result ); } ! this.configHelper = new zmx.XMLRPCHelper( this.configProxy ); this.configHelper.callMethod( this.config.configMethod, []); } *************** *** 133,136 **** --- 129,147 ---- } + function configSuccess( result ) { + trace("Config success!" + _global.serializeObject( result ) ); + + for (var attr in result) { + this.config[attr] = result[attr]; + } + this.proxy.configSuccess(); + this.proxy.trace("XMLRPC ConfigSuccess: " + _global.serializeObject( this.config )); + } + + function configFailure( msg ) { + trace("Config failure!" + msg); + this.proxy.configFailure(); + } + static function checkDef( x, defX ) { // shorthand.. |