0 Replies Latest reply on May 19, 2012 7:11 PM by devuser12

    process facebook feeds dynamically

    devuser12

      hi,

      I am trying to process the user feeds retrieved from facebook by dynamically adding them to the flash app, and i need the feed to be displayed in a box with its publisher name and his picture beside it (as normal)..

      the question is how could i display them aligned under each other if i don't know their heights(how long the post is)? is there a way to just add them under each other without specifying the height? like in html adding divs under each other?

      and other question how to add a scroll bar if the content exceeds the flash window?

      iam new to as3 & flash so any advice will help.. thanks..

      my code:

              protected function getFeedsHandler(result:Object,fail:Object):void
             
      {
                 
      if(result)
                 
      {
                     
      var i:Number;

                     
      for(i=0;i<10;i++)
                         
      if(result[i])
                         
      {
                             
      var fdLbl= new Label();
                              addElementAt
      (fdLbl,1);

                              fdLbl
      .text=result[i].message;
                              fdLbl
      .x=20;
                              fdLbl
      .y=(i+2)*100;
                              fdLbl
      .width=400;

                             
      var fdImg= new Image();
                              addElementAt
      (fdImg,1);

                              fdImg
      .source=FacebookDesktop.getImageUrl(result[i].from.id,"small");
                              fdImg
      .x=20;
                              fdImg
      .y=(i+2)*80;
                              fdImg
      .width=400;

                             
      var nameLbl= new Label();
                              addElementAt
      (nameLbl,1);

                              nameLbl
      .text=result[i].from.name;
                              nameLbl
      .x=20;
                              nameLbl
      .y=(i+2)*90;


                         
      }
                 
      }

      the interface:

      <s:Button id="loginoutBtn" right="10" top="10" label="Log out"
               
      click.loggedin="logout(event)"
               
      label.loggedout="Log in" click.loggedout="login(event)"/>
      <s:Form includeIn="loggedin" left="70" top="10">
         
      <s:FormItem label="User">
             
      <s:Label id="nameLbl" text=""/>
         
      </s:FormItem>
         
      <s:FormItem label="birthday">
             
      <s:Label id="brthday"/>
         
      </s:FormItem>
         
      <s:FormItem label="feeds">
             
      <s:Image id="feedImg"/>
             
      <s:Label id="feedLbl" x="0"/>
             
      <s:Label id="statusLbl" width="405"/>
         
      </s:FormItem>
      </s:Form>
      <s:Image id="userImg" includeIn="loggedin" left="10" top="10" width="50"/>