I gotta an uncommon problem over here.
I have to call the tinnyURL service to shorten my URL, it is working fine. After that, I have to call another tab, but for some reason, it calls a pop-up.
I'm assuming that the problem is when I call the tinyURL service, but I don't know how to fix it.
Below is the code I've wrote for this.
variables.url = String("http://www.google.com");
sendAndLoad("http://tinyurl.com/api-create.php", variables);
// tinyURL service
private function sendAndLoad( url:String, _vars:URLVariables ):void {
request = new URLRequest(url);
request.data = _vars;
request.method = URLRequestMethod.POST;
_urlloader = new URLLoader();
_urlloader.dataFormat = URLLoaderDataFormat.TEXT;
_urlloader.addEventListener(Event.COMPLETE, handleComplete);
_urlloader.load(request);
}
// once I get the tinyURL response this function is triggered
private function handleComplete(event:Event):void {
var s:String = event.target.data;
finalURL = "http://twitter.com/home?status=" + MESSAGE + " " + s;
var url:URLRequest = new URLRequest(finalURL);
navigateToURL(url);
}
So I have the same "way-to-do" for the facebook (without the tinyURL) and it works properly, I think it is a problem within the first method (sendAndLoad();)
I've used already alternatives like:
http://skovalyov.blogspot.com/2007/01/how-to-prevent-pop-up-blocking-in.html and http://snipplr.com/view.php?codeview&id=29544
PS:The twitter is working IF I unblock the pop ups on chrome. All I want to do is to open in a new tab.
Let me know if you guys already had some problem like that, it is pretty troublesome!
Thank you.