views:

3448

answers:

8

I've been checking out facebook connect stuff from the new actionscript 3 library from Adobe. I have been trying to figure out how to use the facebook connect button inside of a flex app.

In an html page you would us the fbml and it would automatically put the facebook connect button on your page and when the user clicks on it it pops up the face div and lets the user login. Well you can't use that in flex. So I could put it on the page containing the swf but, that's why I'm using flex and not html. I've seen it done by the guys at Universal Mind so I know it's possible. I just need a little direction.

I know the function to use in the facebook connect api to cause that login dialog to come up I just can't figure the correct combination.

A: 

This should be applicable to Flex. This would be done using the ExternalInterface calls from within Flash.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html

Darryl E. Clarke
+2  A: 

Chcek out the Create your first Facebook application with Flex tutorial and in particular the section on Add Facebook login.

dirkgently
True this does show you how to login in to facebook instead of using the facebook connect method as in this example(http://www.somethingtoputhere.com/therunaround/index.php) it just redirects you to facebook to login and then you need to go back to your application once logged in.
smartdirt
A: 

smartdirt,you find who to do that?

I have the same problem

if you have a solution, thanks for telling me!!!

I have not yet found a solution.
smartdirt
A: 

In Adobe facebook-actionscript-api there is a class LoginWindow which you can use.

When you need it this window will open like small flash popup window and it will display facebook login page and enable user to login. All needed events will be raised and you should be connected after that. I didn't tested it but from the code looks like what you need.

Perica Zivkovic
A: 

You have to write a Javascript/HTML wrapper and control it from Flex with ExternalInterface class.

Easy!

Tom
A: 

this developer created this js/flash bridge you are talking about using the ExternalInterface classes. you can download all source files as well. i found it very useful. http://www.wellconsidered.be/blog/2009/01/04/facebook-connect-to-actionscript-3/

yaniv sidi
A: 

There is also a very clean and elegant solution/tutorial at: http://www.stevenvh.be/blog/?p=57

Suma Gowda
A: 

Use this API: http://code.google.com/p/facebook-actionscript-api/

Look at ConnectDemo.

The sample kind of sucks... it forces you to connect before showing the Flex app.

You need to tweek the example to get it to do what you want.

Also, FB depreciated some of the methods, so you have to look up new methods that aren't depreciated.

I'd love to update the sample, but I don't have the time to dedicated to another project.

Alex Cook