-
-
Save RhinoLu/3002431 to your computer and use it in GitHub Desktop.
透過 javascript 貼牆,並回傳 flash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function doShare():void | |
{ | |
if (ExternalInterface.available) | |
{ | |
ExternalInterface.addCallback("onShareSingleComplete", onShareSingleComplete); | |
ExternalInterface.call("myShare", "onShareSingleComplete"); | |
} | |
} | |
public function onShareSingleComplete(result:String):void | |
{ | |
if (result == "false") | |
{ | |
trace("post 失敗 或 不分享"); | |
} | |
else | |
{ | |
trace("post 成功"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myShare(_callBack) | |
{ | |
var feed_obj = {}; | |
feed_obj.to = ""; | |
feed_obj.method = "feed"; | |
feed_obj.name = "標題"; | |
feed_obj.link = "http://www.xxx.com.tw/"; | |
feed_obj.picture = "http://www.xxx.com.tw/images/fb.jpg"; | |
feed_obj.description = "內文"; | |
feed_obj.display = "popup"; | |
FB.ui(feed_obj, function(response) | |
{ | |
if (response && response.post_id) | |
{ | |
document["flashcontent"][_callBack](response.post_id); | |
} | |
else | |
{ | |
document["flashcontent"][_callBack]("false"); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment