PDA

View Full Version : Why I canít get the message after showing a swf file in a html?




xiaohuli170
Jun 17, 2009, 03:21 AM
Using

* (NSString *)webScriptNameForSelector:(SEL)sel

{

if (sel == @selector(JSWriteCocoaAppLog:))
return @"WriteCocoaAppLog";
return nil;

}

* (BOOL)isSelectorExcludedFromWebScript:(SEL)selector

{

if (selector == @selector(JSWriteCocoaAppLog:))
return NO;

return YES;

}

*

(void)awakeFromNib { WebScriptObject* m_winScriptObject = [self windowScriptObject];

if (m_winScriptObject != nil) [m_winScriptObject setValue:self forKey:@"cocoaApp"];

}

methods I can received message from the javascript. just like cocoaApp.WriteCocoaAppLog("JSCommand"); in console can write the JSCommand. but after showing a swf file , I didn't receive the message from the javascript , I didn't know the reason.