您好,我最近从CoffeeCup中获取了Web Image Studio程序,我每次尝试打开它或打开文件夹时都会遇到此错误。
此页面上的脚本发生错误。 行:119 查尔:11 错误:对象不支持属性或方法'receiveMessage' 代码:0 URL:file:/// C:/ Users / Alec%20Grogan / AppData / Local / Temp / wisembeddedpreview 1404840242 / DrawingEngine.html 要继续在此页面上运行脚本吗? 是的|否
所以我决定打开它正在谈论的文件,这里的代码是否有任何问题?
<style>
body
{
margin: 0;
padding: 0;
background-color: #f5f5f5;
}
</style>
<title>DrawingEngine</title>
<script language="JavaScript">
(function() {
/**
* Logger namespace to access the log function used by
* the engine.
*/
window.Logger = {
/**
* Interface of the log method. The DrawingEngine
* will call this method passing a string to it.
* To get access to the log, just override this method.
*/
log: function( str ) {}
};
/**
* DrawingEngine object (Auto-created)
*/
window.drawingEngine = (function( id ) {
var messageProcessingMethods = {
mac : function(str) {
window.AppPort.processMessage_( str );
},
win : function(str) {
window.external.processMessage( str );
},
/**
* Method used by the testing web page.
* Simulates an external interface using Javascript and HTML.
*/
web : function(str) {
exiface && exiface.process( str );
}
};
var platform = ( window.AppPort ) ? 'mac' : ( window.external ) ? 'win' : 'web';
var messageProcessor = messageProcessingMethods[ platform ];
/**
* Interface of the Javascript exposed by the flash object
*/
var flashObjectElementInterface = {
/**
* Tells the flash object to receive a message and do something with it.
* It expects false when the message was not processed.
*/
receiveMessage: function( message ) {
var error = '<Log message="Message not processed. Engine not listening" level="ERROR"/>';
Logger.log( error );
return error;
},
/**
* Sets an attribute of the flash object to a specific value
*/
setAttribute: function( attr, value ) {
}
};
var getFlashObject = (function() {
var flashObject;
return function() {
if( !flashObject ) {
flashObject = document[ id ] || window[ id ] || flashObjectElementInterface;
}
return flashObject;
};
})();
/**
* DrawingEngine constructor.
*/
function DrawingEngine()
{}
/**
* Handles a message that came from the flash object and passes
* it to the external interface. It returns the same the external
* interface returns.
*/
DrawingEngine.prototype.messageFromEngine = function( messageString ) {
Logger.log( messageString );
return messageProcessor( messageString );
}
/**
* Handles a message that was sent to the flash object. It tries
* to tell the flash to receive the message. It returns the same
* flash returns.
*/
DrawingEngine.prototype.messageToEngine = function( messageString ) {
Logger.log( messageString );
return getFlashObject().receiveMessage( messageString );
}
/**
* Sets the flash object size to an specific value
*/
DrawingEngine.prototype.setWindowSize = function( width, height )
{
var fo = getFlashObject();
fo.setAttribute( "width", width );
fo.setAttribute( "height", height );
}
return new DrawingEngine();
})( "DrawingEngine" );
})();
// Legacy function. Used by native ui
function sendTextToFlash( str ) {
return drawingEngine.messageToEngine( str );
}
// Necessary to update the Flash size with W7 maximizing gestures
function setFlashObjectSize( width, height ) {
drawingEngine.setWindowSize( width, height );
}
B.T.W。我已经联系过那里的支持,但有些想法没有帮助。还有什么程序我需要安装才能运行它?我只是恢复了我的电脑,所以除了一些基本的程序之外没有额外的程序。
这是论坛的链接,我也问过这个 http://www.coffeecup.com/forums/web-image-studio/script-error/#post235708