Read more about this book |
(For more resources on this subject, see here.)
The reader will be benefit from referring the previous article on Getting Started with Flash and Facebook.
The Facebook JavaScript SDK is what makes it possible for our Flash Player application to obtain details of any active Facebook sessions, and it allows our application to perform actions such as prompting for authentication or requesting additional permissions.
For our Flash Player application to integrate with Facebook, we will need some form of HTTP server, so that we can run our application from an http://-based URL, rather than simply launching a file from a local folder on your computer. Ideally we need a live, publicly-accessible domain under our control, and we’ll configure our Facebook Application to use pages on that domain as the basis for our Canvas and Tab applications.
In addition, if we can, it would be most efficient (but not essential) to have an HTTP server set up on our local machine—allowing us to test and debug our Flash Player applications locally, without having to re-upload files to a remote site every time we need to test new functionality.
<script type="text/javascript"
src="http://connect.facebook.net/en_US/all.js"></script>
<div id="fb-root"></div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html lang="en" xml:
lang="en">
<head>
<title>${title}</title>
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto;
text-align:center; background-color: ${bgcolor}; }
#flashContent { display:none; }
</style>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
var swfVersionStr = "${version_major}.${version
_minor}.${version_revision}";
var xiSwfUrlStr = "${expressInstallSwf}";
var flashvars = {};
var params = {};
params.quality = "high";
params.bgcolor = "${bgcolor}";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "${application}";
attributes.name = "${application}";
attributes.align = "middle";
swfobject.embedSWF(
"${swf}.swf", "flashContent",
"${width}", "${height}",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
swfobject.createCSS("#flashContent",
"display:block;text-align:left;");
</script>
<script type="text/javascript"
src="http://connect.facebook.net/en_US/all.js"></script>
</head>
<body>
<div id="flashContent">
<p>To view this page ensure that Adobe Flash
Player version ${version_major}.${version_minor}.
${version_revision} or greater is installed.</p>
</div>
<div id="fb-root">
</div>
</body>
</html>
Given URL is not allowed by the Application configuration.
I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…
Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…
Once we learn how to deploy an Ubuntu server, how to manage users, and how…
Key-takeaways: Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…
While developing a web application, or setting dynamic pages and meta tags we need to deal with…
Software architecture is one of the most discussed topics in the software industry today, and…