Flash'In'App - Full screen app not working(Read 13605 times)
Flash'In'App - Full screen app not working on: June 16, 2010, 07:52:38 AM
I'm trying to center an ESFlashView within a larger fullscreen window.  I've added a MainController and am performing the ESFlashView initialization in applicationDidFinishLaunching.  The ESFlashView loads correctly in a non-fullscreen window if I do so with this code:

Code: javascript:void(0);
-(void)applicationDidFinishLaunching:(NSNotification*)notification
{
// create an ESFlashView to house the Flash content
NSRect theFrame = [window frame];
flashView = [[ESFlashView alloc] initWithFrame:NSMakeRect(0.5 * (theFrame.size.width - 1024),
  0.5 * (theFrame.size.height - 768),
  1024, 768)];
[[window contentView] addSubview:flashView];
NSString *strPath = [[NSBundle mainBundle] pathForResource:@"flash1" ofType:@"swf"];
NSURL *url = [NSURL fileURLWithPath:strPath];
NSURL *baseURL = [NSURL fileURLWithPath:[strPath stringByDeletingLastPathComponent]];
[flashView loadMovie:[NSData dataWithContentsOfURL:url] atURL:url withBaseURL:baseURL];
}

But once I add the code bits that launch a fullscreen window instead, the Flash no longer loads.  I just get a big black screen.  Any idea what's going wrong?

Code: javascript:void(0);
-(void)applicationDidFinishLaunching:(NSNotification*)notification
{
// Capture the main display
if (CGDisplayCapture(kCGDirectMainDisplay) == kCGErrorSuccess)
{
// create a fullscreen window abover the "shielding window level"
window = [[NSWindow alloc] initWithContentRect:[[NSScreen mainScreen] frame]
   styleMask:NSBorderlessWindowMask
   backing:NSBackingStoreBuffered
   defer:NO
   screen:[NSScreen mainScreen]];
[window setLevel:CGShieldingWindowLevel()];
[window setBackgroundColor:[NSColor blackColor]];
[window makeKeyAndOrderFront:nil];

// create an ESFlashView to house the Flash content
NSRect theFrame = [window frame];
flashView = [[ESFlashView alloc] initWithFrame:NSMakeRect(0.5 * (theFrame.size.width - 1024),
  0.5 * (theFrame.size.height - 768),
  1024, 768)];
[[window contentView] addSubview:flashView];
NSString *strPath = [[NSBundle mainBundle] pathForResource:@"flash1" ofType:@"swf"];
NSURL *url = [NSURL fileURLWithPath:strPath];
NSURL *baseURL = [NSURL fileURLWithPath:[strPath stringByDeletingLastPathComponent]];
[flashView loadMovie:[NSData dataWithContentsOfURL:url] atURL:url withBaseURL:baseURL];
}
}



Re: Flash'In'App - Full screen app not working Reply #1 on: June 16, 2010, 01:00:55 PM
As far as I understand you're using a demo version of Flash'In'App.

The fact is that when you're using demo version, Flash'In'App displays a nag screen when loading a SWF file, and SWF file won't load until you close this nag screen.

From the code that you've posted, we can see that you placed a window with ESFlashView over all other windows, including the nag screen. As a result, nag screen is under your window.

Please, try to press "Enter" key on the keyboard after launching your application. This is supposed to close the nag screen and your SWF file will proceed loading.

« Last Edit: June 16, 2010, 01:02:52 PM by Travis »



Re: Flash'In'App - Full screen app not working Reply #2 on: June 16, 2010, 04:34:22 PM
That was it exactly.  Thanks for being so quick with the idiot check.  I'll be purchasing my license shortly.



 

Sitemap 1 2 3 4 5