我正在尝试从Flash发布照片到Tumblr.com,但会导致错误#2101
错误#2101:传递给的字符串 URLVariables.decode()必须是 包含URL的编码查询字符串 名称/值对
这是我正在使用的代码:(ActionScript3)
import com.adobe.images.PNGEncoder;
import flash.display.BitmapData;
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.SecurityErrorEvent;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.utils.ByteArray;
//
var myLoader:URLLoader;
myLoader = new URLLoader();
myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
//
var urlVars:URLVariables = new URLVariables();
urlVars.email = "***@*****.de";
urlVars.password = "*****";
//
urlVars.type = "photo";
//
var b:BitmapData = new BitmapData(mc.width,mc.height,true);
b.draw(mc);
var png:ByteArray = PNGEncoder.encode(b);
//
urlVars.data = png;
//
var urlRequest:URLRequest = new URLRequest("http://www.tumblr.com/api/write");
//
urlRequest.contentType = "application/octet-stream";
urlRequest.method = URLRequestMethod.POST;
urlRequest.data = urlVars;
myLoader.load(urlRequest)
任何想法都非常受欢迎。
由于 鲍勃