ç°¡åã«Flashã§mixiãã¼ã¿ã«ã¢ã¯ã»ã¹ããæ¹æ³
mixiã¢ããªãå
¬å¼ã«å
¬éããã¾ããã
ãã£ãããªã®ã§éçºã«å½¹ã«ç«ã¡ãããªãµã³ãã«ããã°ã©ã ãä½æãã¾ããã
flixiã¨ããã©ã¤ãã©ãªã使ç¨ããã¨
- ãªã¼ãã¼
- ãã¤ãã¯
- ã³ãã¥ããã£
ããããã®æ å ±ãFlashã®ActionScriptã§
fx = new flixi();
fx.addEventListener( flixiPersonEvent.GET_OWNER , onGetPerson );
fx.addEventListener( flixiPeopleEvent.GET_OWNERS_PEOPLE , onGetPeople );
fx.addEventListener( flixiCommunityEvent.GET_OWNERS_COMMUNITY , onGetCommunity );
fx.getOwner();
fx.getOwnersPeople();
fx.getOwnersCommunity();
ã¨æ¸ãã ãã§ç°¡åã«åå¾ãããã¨ãã§ãã¾ãã
ãµã³ãã«ãã¼ã¸ã¯ãã¡ã
http://mixi.jp/run_appli.pl?id=7077
#IE6ã¯ã¡ãã£ã¨è¡¨ç¤ºãããªãã®ã§ãã¡ã£ã¨å¾
ã£ã¦ã¦ãã ããæ±
flixiã®è¨ç½®æ¹æ³
ã¾ãã¯ã©ã¤ãã©ãªã®ãã¦ã³ãã¼ã
flixiコミュのflixi パッケージからダウンロード
次ã«ãã¦ã³ãã¼ããã¦è§£åãã¦å¾ããã opensocial_xml ãã©ã«ãã®ä¸ã® flashConnector.js ãèªåã®ãµã¼ãã¼ã«ã¢ãããã¼ããã¦è¨ç½®ã
ãããFlashã¨jsãé£æºãã¦Flashããç°¡åã«æ
å ±ãåå¾ã§ããããã«ãªãã¾ãã
ã¬ã¸ã§ããxmlã®è¨å®ãã¨ãããã
<?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="moetenMixiTest"> <Require feature="flash" /> <Require feature="opensocial-0.8"/> </ModulePrefs> <Content type="html" view="canvas"> <![CDATA[ <script type="text/javascript"> gadgets.util.registerOnLoadHandler( function () { var path = "http://hogehoge/";//flashConnector.jsãç½®ãããã£ã¬ã¯ã㪠var date = new Date(); var swf = "http://hogehoge/mixiapp.swf?" + date.getTime();//swfãã¡ã¤ã«ã®ä½ç½® var width = "940"; var height = "500"; function load(){ loadFlash( swf , width , height ); } var sc = document.createElement('script'); sc.type = 'text/javascript'; if (window.ActiveXObject) { sc.onreadystatechange = function(){ if (sc.readyState == 'complete'){load();} if (sc.readyState == 'loaded') {load();} } }else{ sc.onload = function(){ load(); } } sc.src = path + "flashConnector.js"; document.body.appendChild(sc); } ); </script> ]]> </Content> </Module>
ãã®ã¬ã¸ã§ããxmlã®URLãmixiå´ã«æãã¦ãããã°
http://hogehoge/mixiapp.swf ãåä½ãã¾ãããã£ãã·ã¥é¢ä¿ã§åèªã¿è¾¼ã¿ã§ã¯è¡¨ç¤ºãããªãå ´åãããã®ã§ãä½åº¦ããã©ã¦ã¶ã®æ»ããé²ãã§è¡¨ç¤ºããã¦ã¿ãã¨ããã¨æãã¾ãã
Flexã®ã½ã¼ã¹ã³ã¼ãã¯ãã¡ã
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" horizontalAlign="left" creationComplete="init()" backgroundColor="0xffffff" width="940" height="500"> <mx:Script> <![CDATA[ import flixi.*; private var fx:flixi; private function init():void{ fx = new flixi(); fx.addEventListener( flixiPersonEvent.GET_OWNER , onGetPerson ); fx.addEventListener( flixiPeopleEvent.GET_OWNERS_PEOPLE , onGetPeople ); fx.addEventListener( flixiCommunityEvent.GET_OWNERS_COMMUNITY , onGetCommunity ); fx.getOwner(); fx.getOwnersPeople(); fx.getOwnersCommunity(); } private function onGetPerson(iEvent: flixiPersonEvent): void{ dg1.dataProvider = iEvent.person; } private function onGetPeople(iEvent: flixiPeopleEvent): void{ var personArr:Array = new Array(); for (var i: int = 0; i < iEvent.length; i++) { personArr.push( iEvent.getItemByIndex(i) ); } dg2.dataProvider = personArr; } private function onGetCommunity(iEvent: flixiCommunityEvent): void{ var communityArr:Array = new Array(); for (var i: int = 0; i < iEvent.length; i++) { communityArr.push( iEvent.getItemByIndex(i) ); } dg3.dataProvider = communityArr; } ]]> </mx:Script> <mx:Text text="ãªã¼ãã¼æ å ±(getOwner())"/> <mx:DataGrid id="dg1" y="10" x="10" height="50" rowCount="1" width="100%"> <mx:columns> <mx:DataGridColumn> <mx:itemRenderer> <mx:Component> <mx:Image source="{data.thumbnailURL}"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="isOwner" dataField="isOwner"/> <mx:DataGridColumn headerText="isViewer" dataField="isViewer"/> <mx:DataGridColumn headerText="hasApp" dataField="hasApp"/> <mx:DataGridColumn headerText="name" dataField="name"/> <mx:DataGridColumn headerText="nickname" dataField="nickname"/> <mx:DataGridColumn headerText="id" dataField="id"/> <mx:DataGridColumn headerText="thumbnailURL" dataField="thumbnailURL"/> <mx:DataGridColumn headerText="profileURL" dataField="profileURL"/> <mx:DataGridColumn headerText="age" dataField="age"/> <mx:DataGridColumn headerText="birthDate" dataField="birthDate"/> <mx:DataGridColumn headerText="address" dataField="address"/> <mx:DataGridColumn headerText="gender" dataField="gender"/> <mx:DataGridColumn headerText="bloodType" dataField="bloodType"/> </mx:columns> </mx:DataGrid> <mx:Text text="ãã¤ãã¯æ å ±(getOwnersPeople())"/> <mx:DataGrid id="dg2" y="68" x="10" height="171" width="100%"> <mx:columns> <mx:DataGridColumn> <mx:itemRenderer> <mx:Component> <mx:Image source="{data.thumbnailURL}"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="isOwner" dataField="isOwner"/> <mx:DataGridColumn headerText="isViewer" dataField="isViewer"/> <mx:DataGridColumn headerText="hasApp" dataField="hasApp"/> <mx:DataGridColumn headerText="name" dataField="name"/> <mx:DataGridColumn headerText="nickname" dataField="nickname"/> <mx:DataGridColumn headerText="id" dataField="id"/> <mx:DataGridColumn headerText="thumbnailURL" dataField="thumbnailURL"/> <mx:DataGridColumn headerText="profileURL" dataField="profileURL"/> <mx:DataGridColumn headerText="age" dataField="age"/> <mx:DataGridColumn headerText="birthDate" dataField="birthDate"/> <mx:DataGridColumn headerText="address" dataField="address"/> <mx:DataGridColumn headerText="gender" dataField="gender"/> <mx:DataGridColumn headerText="bloodType" dataField="bloodType"/> </mx:columns> </mx:DataGrid> <mx:Text text="ã³ãã¥ããã£æ å ±(getOwnersCommunity())"/> <mx:DataGrid id="dg3" y="310" x="10" height="153" width="100%"> <mx:columns> <mx:DataGridColumn> <mx:itemRenderer> <mx:Component> <mx:Image source="{data.thumbnailURL}"/> </mx:Component> </mx:itemRenderer> </mx:DataGridColumn> <mx:DataGridColumn headerText="id" dataField="id"/> <mx:DataGridColumn headerText="name" dataField="name"/> <mx:DataGridColumn headerText="isOwner" dataField="isOwner"/> <mx:DataGridColumn headerText="isViewer" dataField="isViewer"/> </mx:columns> </mx:DataGrid> </mx:Application>