0 Replies Latest reply on Jan 24, 2011 7:03 AM by sarahd20

    Facebook Graph API - Displaying users home feed

    sarahd20

      Right now i have it displaying in label components , right now i just have it looping in a for loop but everything is sat on top of one another

      I want to display them in data grid component but i haven't a clue how i am a newbie too flex 4 any help would be great

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"

      xmlns:s="library://ns.adobe.com/flex/spark"

      xmlns:mx="library://ns.adobe.com/flex/mx" width="300" height="200"

      creationComplete="initApp()">

      <fx:Declarations>

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      </fx:Declarations>

       

       

      <s:states>

      <s:State name="loggedout"/>

      <s:State name="loggedin"/>

      <s:State name="photoUpload"/>

      </s:states>

       

      <fx:Script>

      <![CDATA[

      import com.facebook.graph.FacebookDesktop;

       

      import flash.display.DisplayObject;

       

       

      protected function initApp():void

      {

      FacebookDesktop.init("APP ID",getFeedHandler);

      FacebookDesktop.api("/me/home",getFeedHandler);

       

      }

       

       

      public function getFeedHandler(result:Object, fail:Object):void

      {

       

      for ( var i:int = 0; i < 4; i++ )

      {

       

      userNameLbl.text=result[i].from.name;

      userImgFeed.source =FacebookDesktop.getImageUrl(result[i].from.id,"small");

      statusUpdate.text=result[i].message;

      createdTimeLbl.text=result[i].updated_time;

       

       

       

       

       

      }

       

       

      }

       

      ]]>

      </fx:Script>

       

      <!-- UI Components -->

       

      <!-- News Feed Screen -->

       

        <mx:Image includeIn="loggedin" x="98" y="194" id="userImgFeed" width="44" height="39"/>

      <s:Label includeIn="loggedin" x="150" y="221" width="239" height="58" id="statusUpdate"/>

      <s:Label includeIn="loggedin" x="296" y="194" width="227" height="19" id="createdTimeLbl"/>

                <s:Label includeIn="loggedin" x="296" y="194" width="227" height="19" id="userNameLbl"/>

       

       

      </s:Group>