It seems that you want to have a button on the flash application, and after clicking on it, the facebook page opens, which separates the video / image related to the button pressed. What you want to do is simply create a button that, when clicked, opens a new website in facebook using its api share, which has the following format:
var facebookShare:String = "http://www.facebook.com/share.php?u=' + encodedVideoLink + '&t='+ encodedVideoText";
If the parameter u denotes the link that you want to share, and the parameter t denotes the name of the part that you want to share, whether it is an image or video.
You want to add an event listener to MouseEvent.CLICK, which has as a callback function a method that handles opening a facebook page that passes the facebookShare variable, as shown above. To open another page in your browser, you can use this AS3 class called URLNavigator: http://www.danishmetal.dk/project/source/com/zorked/URLNavigator.as
To summarize, something like this:
var facebookShare:String = "http://www.facebook.com/share.php?u=' + encodedVideoLink + '&t='+ encodedVideoText"; facebookButton.addEventListener(MouseEvent.CLICK, this._goToUrl(facebookShare)); private function _goToUrl(link:String):Function { var window:String = "_blank", feats = "", thisOverlay:Object = this; // to not lose scope when returning a func return function (e:MouseEvent):void { trace("Opening link to:"+link); try { URLNavigator.ChangePage(link, window, feats); } catch (e:Error) { trace("error launching "+link+" in "+window+" with feature set "+feats); } } }
Hope this helps. If you have questions regarding the code, please let me know.
source share