错误发布照片脸书

时间:2012-01-07 16:47:35

标签: facebook mobile flexbuilder

我正在使用GraphAPI_Mobile_1_8_1.swc通过Flex 4.6制作的移动应用程序在Facebook上发送照片,但发布时出错,但我无法识别,有人可以帮助我吗? 记下我正在做的代码......

<? xml version = "1.0" encoding = "utf-8"?>
<s: View xmlns: fx = "http://ns.adobe.com/mxml/2009"
xmlns: s = "library: / / ns.adobe.com / flex / spark" title = "PostPhotos"
creationComplete = "init (event)">
<fx:Declarations>
<! - Place non-visual elements (eg, services, value objects) here ->
</ fx: Declarations>

<fx:Script>
<! [CDATA [
com.facebook.graph.FacebookMobile import;

mx.events.FlexEvent import;
mx.rpc.events.ResultEvent import;

public var permissions: Array = ["user_photos", "user_birthday", "read_stream", "publish_stream"];

public function init (event: FlexEvent): void {
FacebookMobile.init ("my id" OnLogin);
}


protected function postPhoto(): void {
var values: Object = {message: 'mobiFace' fileName 'FILE_NAME', image: imgUser};
FacebookMobile.api ('/ me / photos', handlePhoto, values​​, 'POST');
}


protected function handlePhoto(response: Object, fail: Object): void {
imgUser.source = null;
lblStatus.Text = (response)? 'Photograph posted successfully', 'Error in posting';
}


]]>
</ fx: Script>
<s:Image id="imgUser" x="10" y="10" width="157" height="117" source="image/facebook (6).png"/>

<s:Label id="lblStatus" x="9" y="219" />
<s:Button x="10" y="147" width="157" label="Post photo" click="{postPhoto()}"/>
</ s: View>

我正在发布图片中的任何图片... 发布时出错,但作为函数handlePhoto返回......我不知道为什么......

1 个答案:

答案 0 :(得分:0)

我转换为bitmapData imgUser Direct ....

protected function postPhoto (): void {
   var values: Object = {message: '+ Flex Mobile Post', image: imgUser.bitmapData};
   FacebookMobile.api ("/ me / photos", handlePhotovalues​​, "POST");
}