Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TurboLag

macrumors member
Original poster
Feb 24, 2004
85
0
I have developed an application in Obj-C with Cocoa which interfaces with a custom USB device. There is a standalone Flash application (.swf) I would like to embed into my application. Is this possible?

Basically, I would like my Obj-C app to be the interface between the USB device and the Flash application. Is there a Flash object that could be inserted into the application within Interface Builder, similar to how OpenGL is embedded?

Thanks.
 

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
Cork, Ireland.
There isn't a Flash class as such; but what you can do is create a html page to load that swf (you can include this page inside your app bundle), and then use a (Webkit) WebView to load that page.

You'll be able to get FSCommands back from the swf and set variables in the swf, and thus have 2-way communication.
 

icchapuran

macrumors newbie
Feb 6, 2009
1
0
did you try using Webkit

I would like to embed a flash object into Cocoa and communicate between the two. Can you please guide me through the process.
Thanks.
 

ttiimmff

macrumors newbie
Jan 14, 2010
2
0
Are there other alternatives beside Webview and Flash'in'App?

We need to create 64-bit code and Flash'n'App does not support that yet.

The problem we had with WebView is that Flash display is 'jerky' and we need a way to determine when the flash file has finished playing, which we haven't been able to do with Webview.

thanks!
 

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
Cork, Ireland.
Any suggestions? A suggestion or idea would be greatly appreciated.

thank you

For performance, there isn't much you can do. It's not great - but the 10.1 beta seems to be much better. I tried some animation benchmarks, and saw almost 100% improvements in framerate. If you're mostly playing video, your results may vary greatly.

If you want to determine if Flash is done playing (I assume you're talking about Flash video here), I'd do it as follows:

- Create a Flash movie player swf, and embed this in the html in the Webview.
- When you want to play a video, load it into the player swf.
- In the player swf, create a timer which checks at what point the video is at. If it hasn't changed since the last time the timer fired (and the video isn't paused), then it's at the end.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.