title: Posting an image with on facebook using flex
body: <p>I trying to post an image along with the link on facebook.I am able to login get the user details but I am not able to post the image and the link.Following is the code I used</p>
  
  <pre><code>&lt;s:Application 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="600"   height="300" 
             creationComplete="initApp()"&gt;
  &lt;s:states&gt;
      &lt;s:State name="loggedout"/&gt;
      &lt;s:State name="loggedin"/&gt;
  &lt;/s:states&gt;
  &lt;fx:Declarations&gt;
      &lt;!-- Place non-visual elements (e.g., services, value objects) here --&gt;
  &lt;/fx:Declarations&gt;
  &lt;fx:Script&gt;
      &lt;![CDATA[
          import com.facebook.graph.Facebook;
          import com.facebook.graph.controls.Distractor;
  
          protected function initApp():void
          {
              Facebook.init("XXXX",loginHandler);
          } 
          protected function loginHandler(success:Object,fail:Object):void
          {
              if(success){    
                  currentState="loggedin"; 
                  Facebook.api("/me",getMeHandler);
                  userImg.source=Facebook.getImageUrl(success.uid,"small");
                  Facebook.api("/me/statuses",getStatusHandler);
              } 
          }
          protected function login():void
          {
              Facebook.login(loginHandler,  {perms:"user_birthday,read_stream,publish_stream"});
  
          }
          protected function getMeHandler(result:Object,fail:Object):void{
              nameLbl.text=result.name;
              birthdayLbl.text=result.birthday;
          }
          protected function logout():void
          {
              Facebook.logout(logoutHandler);
              currentState="loggedout";
          }
          protected function getStatusHandler(result:Object, fail:Object):void
          {
              statusLbl.text=result[0].message;
          }
          protected function submitPost():void
          {
              var obj:Object = new Object();
              obj.message = statusInput.text;
              obj.link = "url of the image stored on the server";
              obj.type ='link';
              Facebook.api("/me/feed",submitPostHandler,obj, "POST");
  
          }
          protected function submitPostHandler(result:Object,fail:Object):void
          {
              statusInput.text="";
              Facebook.api("/me/statuses",getStatusHandler);
          }
          protected function logoutHandler(response:Object):void{
  
          }
  
      ]]&gt;
  &lt;/fx:Script&gt;
  
  &lt;s:Button label="Log in" includeIn="loggedout" right="10" top="10" click="login()" skinClass="skins.FBLoginButtonSkin"/&gt;
  &lt;s:Button includeIn="loggedin" label="Log out" right="10" top="10" click="logout()" skinClass="skins.FBLogoutButtonSkin"/&gt;
  &lt;mx:Form includeIn="loggedin" top="10" left="70"&gt;
      &lt;mx:FormItem label="User"&gt;
          &lt;s:Label id="nameLbl"/&gt;
      &lt;/mx:FormItem&gt;
      &lt;mx:FormItem label="Birthday"&gt;
          &lt;s:Label id="birthdayLbl"/&gt;
      &lt;/mx:FormItem&gt;
      &lt;mx:FormItem label="Status"&gt;
          &lt;s:Label id="statusLbl"/&gt;
      &lt;/mx:FormItem&gt;
      &lt;mx:FormItem label="Post status" direction="horizontal"&gt;
          &lt;s:TextInput id="statusInput"/&gt;
          &lt;s:Button label="Submit" click="submitPost()"/&gt;
      &lt;/mx:FormItem&gt;      
  &lt;/mx:Form&gt;
  &lt;mx:Image includeIn="loggedin" id="userImg" top="10" width="50" left="10"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>The image is stored on the public server.Can anyone point me where I am goin wrong???</p>