Embedding Flash in .app, Round Two
Embedding Flash in .app, Round Two
- Subject: Embedding Flash in .app, Round Two
- From: Rachel Blackman <email@hidden>
- Date: Tue, 3 Jan 2006 13:31:58 -0800
As mentioned before, I have need to embed a Flash file in an app
basically as an NSView subclass. Basically, I need to have on this
class something akin to:
- (BOOL) initWithURL:(NSURL) urlToSWF;
- (NSString *) getFlashVariable:(NSString *) var;
- (NSString *) setFlashVariable:(NSString *) var toValue:(NSString *)
val;
And a delegate which accepts fscommand calls from the Flash movie with:
- (void) doFSCommand:(NSString *)command withArgs:(NSString *)args;
I tried using NSMovieView, and wrote a subclass which did all this.
This embedded a number of Flash files quite nicely, including the basic
Macromedia samples. Unfortunately, it doesn't seem to work quite
right.
But with Quicktime 7 you cannot load Flash files containing alpha (and
ours do) or which are compressed (and ours are). And while some sample
files worked fine with setVariable and fscommand interaction using
MCActionFilter stuff and FlashMediaSetFlashVariable, not all -- and not
ours (with the alpha masking removed and compression off, of course) --
did.
It's not a Flash file problem, though: over on Windows XP, embedding
the Flash ActiveX control in a window and loading one of the files on
Windows works fine, both for playback and for interaction/communication
with the ActiveScript code in the Flash file.
Now, being a Mac devotee, I'm certain there has to be a way to do this
at least as cleanly. But NSMovieView clearly isn't going to cut it.
I've gone back to looking at using WebView and just calling the Flash
plugin, but it seems I'll have to do some serious black magic voodoo in
order to have a WebView-derived class that will handle what I want to
do cleanly. (Like rewriting temporary HTML files and loading them, and
doing some really scary dynamic Javascript voodoo to do the
set/get/fscommand stuff.)
So, again, I ask... anyone have any better ideas for me? I'm right now
considering whether or not it would be possible to load the Flash
plugin directly as if I /were/ Webkit, and interact with it that way.
But at this point, I'll take anything: even just a better idea on how
do to this with WebKit so that it's not evil. :)
--
Rachel 'Sparks' Blackman -- sysadmin, developer, mad scientist
"If it is not broken, give me five minutes to redesign it!"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden