daogr / facebook-actionscript-api

Automatically exported from code.google.com/p/facebook-actionscript-api
0 stars 0 forks source link

Bitmapdata or bitmap Upload error 1.6.1 #308

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
ar bmpd:BitmapData = new BitmapData(371, 600, false);
bmpd.draw(holder);
var bitmap:Bitmap = new Bitmap(bmpd);

var values:Object = {message:'My Caption', fileName:'FILE_NAME', image:bmpd};

Facebook.api('/me/feed', handleUploadComplete, values, 'POST');

Error :

at flash.net::URLStream/load()
    at flash.net::URLLoader/load()
    at com.facebook.graph.net::FacebookRequest/loadURLLoader()
    at com.facebook.graph.net::FacebookRequest/call()
    at com.facebook.graph.core::AbstractFacebook/api()
    at com.facebook.graph::Facebook$/api()
    at mainx/handleLogin()
    at com.facebook.graph::Facebook/handleSessionChange()
    at Function/http://adobe.com/AS3/2006/builtin::apply()
    at flash.external::ExternalInterface$/_callIn()
    at Function/<anonymous>()

Original issue reported on code.google.com by dosyaoz...@gmail.com on 27 May 2011 at 6:49

GoogleCodeExporter commented 8 years ago
To post a photo, use 'photos' instead. This will upload to an album 
created/named after your app name. 

var values:Object = {message:'My Caption', fileName:'FILE_NAME', image:bmpd};
Facebook.api('photos', handleUploadComplete, values, 'POST');

Otherwise, call Facebook.api('me/albums') and look for an album called 'Wall 
Photos'. Get the id for this album, and post to that album id rather than 
'me/feed'.

var values:Object = {message:'My Caption', fileName:'FILE_NAME', image:bmpd};
Facebook.api('MY_ALBUM_ID/photos', handleUploadComplete, values, 'POST');

Original comment by edwar...@gmail.com on 30 May 2011 at 4:42

GoogleCodeExporter commented 8 years ago
Thank you for the reply, this method worked. 

Original comment by dosyaoz...@gmail.com on 31 May 2011 at 7:48

GoogleCodeExporter commented 8 years ago
i have another problem. I want to post a bitmapdata to someone's wall on my 
friends list. I want to post it with an ID that belongs to my friend. How can I 
do it?

Original comment by dosyaoz...@gmail.com on 31 May 2011 at 10:00

GoogleCodeExporter commented 8 years ago
You can use the same format and replace the 'me' connection with the user's id 
(friend id)

Original comment by edwar...@gmail.com on 31 May 2011 at 10:31

GoogleCodeExporter commented 8 years ago
I have made it like this 

ar bmpd:BitmapData = new BitmapData(371, 600, false);
bmpd.draw(holder);
var bitmap:Bitmap = new Bitmap(bmpd);
var values:Object = {message:'My Caption', fileName:'FILE_NAME', image:bmpd};
Facebook.api(firendID+'/photos', handleUploadComplete, values, 'POST');
//Facebook.api(firendID+'/feed, handleUploadComplete, values, 'POST');

 but it didn't work. Can you give an example? Thank you

Original comment by dosyaoz...@gmail.com on 1 Jun 2011 at 3:09

GoogleCodeExporter commented 8 years ago
What was the error object in you callback (I'm assuming that's how you know it 
didn't work)?

Note: you spelt "firendID" when the correct spelling is "friendID" (just in 
case that was why it didn't work).

Original comment by rovertn...@gmail.com on 1 Jun 2011 at 9:38

GoogleCodeExporter commented 8 years ago
:D sorry firendID is my language 

var item:Object = listbox3.selectedItem;
var firendID : String = item.ID;

var bmpd:BitmapData = new BitmapData(371, 600, false);
bmpd.draw(holder);
var bitmap:Bitmap = new Bitmap(bmpd);
var values:Object = {message:'My Caption', fileName:'FILE_NAME', image:bmpd};
Facebook.api(firendID +'/photos', handleUploadComplete, values, 'POST');
//Facebook.api(firendID +'/feed, handleUploadComplete, values, 'POST');
Wîth that code, I can post to my own wall or it doesn't work at all.

Original comment by dosyaoz...@gmail.com on 2 Jun 2011 at 6:46

GoogleCodeExporter commented 8 years ago
now all methods not work !!!!!

Original comment by dosyaoz...@gmail.com on 17 Jun 2011 at 2:40

GoogleCodeExporter commented 8 years ago
What do you mean "all methods"? Can you at least login (Facebook.login)?

Original comment by rovertn...@gmail.com on 20 Jun 2011 at 3:34

GoogleCodeExporter commented 8 years ago
public function bmdPost(bmd:BitmapData):void
{

var params:Object = {image:bmd, message:'Test ', fileName:'FILE_NAME'};
  Facebook.api('/me/photos', handleUploadComplete, params);

}

Original comment by dosyaoz...@gmail.com on 20 Jun 2011 at 3:42

GoogleCodeExporter commented 8 years ago
for album creating. callback is fail 

var ob:Object= {name:"isim",message:"mesajim"};
Facebook.api("/albums",handleAlbumCreate,ob,"POST");  

Original comment by dosyaoz...@gmail.com on 20 Jun 2011 at 3:45

GoogleCodeExporter commented 8 years ago
private function init():void
{
            debug.de("set init");
            Facebook.init(config.FACE_APP_ID, handleInit);
}
private function handleInit(response:Object, fail:Object):void 
{
            if (Facebook.getSession() ==null)
                debug.de(Facebook.getSession().toString());         

            if (response)
            {
                debug.de("on init\n");
                //  handleLogin(response, fail);
                login();
            }
            else
            {
                debug.de("init error");
            }
            if (fail)
            {
                login();
            }
}
protected function login():void
{       
var permissions:Array = ["user_photos", "publish_stream", 
"read_stream","friends_photos"];            
            Facebook.login(handleLogin,permissions);            
}

Original comment by dosyaoz...@gmail.com on 20 Jun 2011 at 3:45

GoogleCodeExporter commented 8 years ago
i can't a bitmapData posting my wall
i can't a album create
i cant' a bitmapData post a page album with facebook Web 

Original comment by dosyaoz...@gmail.com on 20 Jun 2011 at 3:47

GoogleCodeExporter commented 8 years ago
default.aspx is 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" 
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <!-- Include support librarys first -->
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
        <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>     
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

        <script type="text/javascript">

            var APP_ID = "126552321294167";         
            var REDIRECT_URI = "http://apps.facebook.com/whiskasidiomdemo/";    

            var PERMS = "user_photos,publish_stream,read_stream"; //comma separated list of extended permissions

            function init() {               
                FB.init({appId:APP_ID, status: true, cookie: true});
                FB.getLoginStatus(handleLoginStatus);
            }

            function handleLoginStatus(response) {
                if (response.session) { //Show the SWF

                    $('#ConnectDemo').append('<h1>You need at least Flash Player 9.0 to view this page.</h1><p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>');                  

                    //A 'name' attribute with the same value as the 'id' is REQUIRED for Chrome/Mozilla browsers
                    swfobject.embedSWF("loader.swf", "ConnectDemo", "520", "600", "9.0", null, null, null, {name:"ConnectDemo"});

                 } else { //ask the user to login

                    var params = window.location.toString().slice(window.location.toString().indexOf('?'));                                     
                    top.location = 'https://graph.facebook.com/oauth/authorize?client_id='+APP_ID+'&scope='+PERMS+'&redirect_uri=' + REDIRECT_URI + params;

                  }
            }

            $(init);
        </script>
    </head>
<body>
        <div id="fb-root" style="width:520px; height:auto; margin:auto;"></div>
        <div style="width:520px; height:auto; margin:auto;"><div id="ConnectDemo"></div>
    </body>
</html>

Original comment by dosyaoz...@gmail.com on 20 Jun 2011 at 3:51

GoogleCodeExporter commented 8 years ago
What could be wrong  

i can't a bitmapData posting my wall
i can't a album create
i cant' a bitmapData post a page album with facebook Web  

i have a project important to me facebook application but i can't 

Original comment by dosyaoz...@gmail.com on 20 Jun 2011 at 4:13

GoogleCodeExporter commented 8 years ago
Sorry, I have almost the same problem, when I call a screen wich contain a 
loaded Image of facebook profile I can't get 'Loader.content', but when I 
launch the function out from Facebook.init(APP_ID, onInit) it works fine, what 
this facebook init make wrong for my app, it is also urgent for me too.

Original comment by mahers...@gmail.com on 21 Jun 2011 at 2:17

GoogleCodeExporter commented 8 years ago
Hy ,

I'm using FacebookDesktop i'm having problems to upload an image to a fan page 
....somebody already try that ?

Cheers

Original comment by pedro.ga...@gmail.com on 27 Jul 2011 at 8:21

GoogleCodeExporter commented 8 years ago
Do you have all the right permissions set up? 
(http://developers.facebook.com/docs/reference/api/permissions/)

Also,

Facebook.api("/albums",handleAlbumCreate,ob,"POST"); should be:
Facebook.api("me/albums",handleAlbumCreate,ob,"POST");

Facebook.api('/me/photos', handleUploadComplete, params); should be:
Facebook.api('/me/photos', handleUploadComplete, params, "POST");

Original comment by rovertn...@gmail.com on 29 Jul 2011 at 10:21

GoogleCodeExporter commented 8 years ago
hi, i am trying to get the photo id back after the photo was upload. Did anyone 
know about this? 

Original comment by sookk...@gmail.com on 3 Aug 2011 at 2:08

GoogleCodeExporter commented 8 years ago
Hey sook...@gmail.com, Facebook should return you the photo id you just 
uploaded in your callback. If you have more problems please start a new issue 
so we can keep this thread focused on the original reporters issue, thank-you.

Original comment by rovertn...@gmail.com on 17 Aug 2011 at 7:50

GoogleCodeExporter commented 8 years ago
Hi I have a issue where in iam able to post the image only by click of a button 
(mouse event). if i detect the user login and automatically call the 
facebook.api next, it is not working even if i simulate a mouse click also, it 
is not working.
But works fine when i click a button(upload image)

Original comment by mura...@pnms.in on 13 Nov 2012 at 4:00

GoogleCodeExporter commented 8 years ago
same problem like MURA...

when i use facebook.login and then call function with facebook.api (for 
upload).. upload stuck and donsnt make callback...
on second click.. the same function makes upload and callback...

if i rewrite code to one function it works in one pass... strange... i want 
separate code :(

Original comment by alchko...@gmail.com on 7 Dec 2012 at 6:23