views:

408

answers:

2

I'm just learning about Flex and I'm loving it. Unfortunatly I still have to make the decision on which RIA technology to use and its dependent on, among other things, from the following case:

How can we wrap a java applet around a Flex application? More specifically, I would like to wrap/integrate NASA's World Wind applet in a Flex panel, similar to what Adrew Trice did with the Google Earth API.

An alternative would be id Flex would support direct access to the 3D hardware through OpenGL or DirectX. But I do not think that that is the case yet, not even through AIR.

Any information on the above items would be great. Thanks

+2  A: 

If you're going to be running in a browser, you can definitely do something much like the example you cite, which essentially runs both the Flash player and the Google Earth plug-in alternatingly on top of one another (in that case, Google Earth situated atop Flash), using JavaScript as the glue responsible for hooking the two together.

As for wrapping Java applets, accessing the hardware, etc., though, no -- you're pretty much confined to the player in that sense. If you're hosting the Flash player in an installed application (as we often do here), or in a browser (e.g., as described above), you can reach out of the box using ExternalInterface, or if you're not, you can plug in to another app using AS3's Socket classes, but that's about it; Flash Player has no facilities for wrapping/embedding non-Flash binaries.

Hope that helps -- feel free to post back in comments and I'll try to help explain whatever additional questions you might have.

Christian Nunciato
Chris, Really appreciate your answer. I'll hit you back if I have further questions. I want to have two prototypes in place, one using Papervision and one using NASA's World Wind. Unfortunately, Papervision does not offer hardware acceleration yet which I can get with through World Wind JDK. I'm also aware that Flex 4, Flash 10 and Papervision X might have some sort of hardware acceleration since nVidea and Adobe are working together on that for the open screen project but not sure how much, when and if it will be full support to 3D acceleration.
bmsantos
A: 

What you need to ask yourself is why on Google Earth would you want to do such a thing? Flex is Flex, not a Java wrapper. There's a reason Flex exists: Java Applet FAIL.

ZaBlanc
Why do you people bother to answer with those kind of responses. Flex has bugs to. Flex is just another tool and answers like that really make people run away from the Flex community.
bmsantos
I agree this isn't really helpful.Stating existing problems with Java applets or how they work would be more constructive, or perhaps explaining the difference between typical use cases of the two rich web platforms.
NateDSaint
My point stands. You choose Java applets or Flex. Embedding an applet in Flex is not what Flex is for.
ZaBlanc