The simple Flash Facebook game
-
Upload
ngoc-linh-nguyen -
Category
Technology
-
view
4.098 -
download
1
description
Transcript of The simple Flash Facebook game
![Page 1: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/1.jpg)
THE SIMPLE FACEBOOK FLASH GAME
Trình bày: Phạm Tiến DũngFlash Developer – VCCorp Company
Email: [email protected]
![Page 2: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/2.jpg)
I - flash và facebook
GAME
flash falls in love with facebook
![Page 3: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/3.jpg)
I - flash và facebook
Đồ họa vector
GAME
98%
PV3D, Tweenlite, Facebook API, BlukLoader...
Developer Community
![Page 4: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/4.jpg)
I - flash và facebook
Website lớn thứ tư thế giới: 340 triệu truy cập/tháng
Tính chia sẻ
Facebook platform
Tính công đồng cao
Tính bất ngờ
GAME
![Page 5: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/5.jpg)
I - flash và facebook
GAME
Chia sẻ
Kết nối bạn bè
Tiếp cận
Kết nối các ứng dụng
Tạo các tương tác phong phú cho việc chia sẻ
thông tin game yêu thích với bạn bè
Dễ dàng tiếp cận hàng triện người sử dụng Facebook thông qua game.
Tạo một mạng xã hội của game, cho phép người sử
dụng cạnh tranh và thi đấu với bạn bè của họ.
Kết nối game với các ứng dụng RÍA qua Facebook Connect.
![Page 6: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/6.jpg)
II - Tạo flash game trên Facebook.
![Page 7: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/7.jpg)
KIẾN TRÚC CỦA CÁC ỨNG DỤNG ĐƯỢC XÂY DỰNG TRÊN FACEBOOK VÀ FLASH PLATFORM
External website applications
Applications on Facebook
Desktop applications
. ứng dụng web đặt trên server của bạn (hosting)
. truy cập qua facebook
. truy cập qua URL riêng của bạn
. ứng dụng đặt trên server của bạn
. thông thường là các ứng dụng AIR
. sử dụng Facebook Connect
. sử dụng kiểu iFrame hoặc FBML.
. các ứng dụng desktop thay thế cho việc hosting
. giống với external website application
II - Tạo flash game trên Facebook.
![Page 8: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/8.jpg)
Flash FBML Facebook application
Flash iFrame Facebook application
Flash Facebook desktop applicationExternal Flash Facebook web application
KIẾN TRÚC CỦA CÁC ỨNG DỤNG ĐƯỢC XÂY DỰNG TRÊN FACEBOOK VÀ FLASH PLATFORM
Tham khảo: http://www.adobe.com/devnet/facebook/
II - Tạo flash game trên Facebook.
![Page 9: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/9.jpg)
II - Tạo flash game trên Facebook.
XÂY DỰNG MỘT GAME
Đăng ký FB
Dùng FB Developer App
Download FB APIs
Tạo một FB Application
Tạo flash game
Deploying
Lấy thông tin user từ FB
Lưu điểm dùng PHP/MySQL
Flash iFrame Facebook application
Tùy chỉnh My Application
![Page 10: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/10.jpg)
II - Tạo flash game trên Facebook.
Tham khảo: http://www.adobe.com/devnet/facebook/#startnow
Đăng ký FB
Dùng FB Developer App
Download FB APIs
Tạo một FB Application
Tùy chỉnh My Application
Facebook Developers Application:http://www.facebook.com/developers/
Download :- Facebook Client Library (PHP)- Facebook Actionscript API (AS 3)
Tạo một Application:
Edit setting > Canvas :: Canvas Page URLTạo Facebook URL cho game của bạn.
Edit setting > Canvas :: Canvas Callback URLĐường dẫn trỏ tơi game trên server của bạn
![Page 11: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/11.jpg)
II - Tạo flash game trên Facebook.
Tạo flash game
Lấy thông tin user từ FB
Lưu điểm dùng PHP/MySQL
View source Kill bugs Game :http://apps.facebook.com/killbugs/
11
Sử dụng ActionsScript 3 để code game..OOP.Design pattern : MVC, Singleton...
![Page 12: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/12.jpg)
II - Tạo flash game trên Facebook.
Tạo flash game
Lấy thông tin user từ FB
Lưu điểm dùng PHP/MySQL
FacebookSessionUtil class
FacebookCall class
GetInfoData class
( Facebook class )
session.validateLogin()
session.login()
( GetInfo class )
( FacebookUser class )
( GetInfoFieldValues class )
( API key, secret Key )
Sử dụng Facebook ActionsScript API Library
![Page 13: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/13.jpg)
II - Tạo flash game trên Facebook.
Tạo flash game
Lấy thông tin user từ FB
Lưu điểm dùng PHP/MySQL
Gửi điểm qua POST hoặc GET methodhttp://....../record_scores.php?score=13
Flash game request tới database qua PHP. gửi nhận và ghi vào database
Nhận giá trị trả về dưới dạng XML .<data>
.<user id=3456257891344” ><score value=”” date=”” /><score value=”” date=”” />...
</user>.....
.</data>
Lưu trữ thông tin user và score bằng MySQL.INFO_USER table.SCORES table
![Page 14: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/14.jpg)
II - Tạo flash game trên Facebook.
Upload Facebook Client Library vào host
Tạo index.php. sử dụng facebook client library để require_login().gửi thông tin từ URL variable tới swf qua flshvars
Gỡ bỏ API key và secret key trong swf
Kiểm tra My Application:. Edit setting > Canvas :: Canvas Callback URL. Edit setting > Canvas :: Canvas Callback URL. Edit setting > Advanced :: Application Type
Test Game
Deploying
![Page 15: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/15.jpg)
III – Demo Game Version
Kill bugs Game :http://apps.facebook.com/killbugs/
11
![Page 16: The simple Flash Facebook game](https://reader035.fdocument.pub/reader035/viewer/2022062220/55528ea2b4c905e8128b4749/html5/thumbnails/16.jpg)
II – Tài liệu tham khảo.
Bắt đầu với Faceboook Actionscript APIDownload: http://code.google.com/p/facebook-actionscript-api/Hướng dẫn: http://www.adobe.com/devnet/facebook/
Khác : Faceboook Bridgehttp://components.zerofractal.com/
FacebookBridge/
Facebook connect to Actionscript 3 http://www.wellconsidered.be/2009/01/04/facebook-connect-to-actionscript-3/
Opensocial Actionscript Client Api : Myspace, Orkut, Hi5, 51.com, Hyve.. http://code.google.com/p/opensocial-actionscript-client/
Sử dụng Faceboook Actionscript API và JavaScript Bridgehttp://code.google.com/p/facebook-actionscript-api/
Các API method của Facebook platform hhttp://wiki.developers.facebook.com/index.php/API