PDA

View Full Version : Custom Google Voice coding help


bigbu
08-24-2009, 04:47 PM
As I play with the below script and test it published it all works except Google Voice doesn’t call my phone, so I'm not sure where the disconnect is after inputting the data. When I test the movie, I get these Output errors:

Error opening URL 'https://clients4.google.com/voice/embed/webButtonConnect'
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: https://clients4.google.com/voice/embed/webButtonConnect
at google_fla::MainTimeline/mouseDownHandler2()

Now I expect to get errors here since I don’t have my computer setup as a web server, but I thought they might possibly help identify the problem.

Here is the script in Flash:

connectMe.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2);

function mouseDownHandler2(event:MouseEvent):void {
var fName:String = fullName.text;
var err:Number = 0;
var myPattern:RegExp = /\w+/;
var phone:RegExp = /[^0-9]/g;
var pNum:String = phoneNumber.text.replace(phone,"");
if(fName.match(myPattern) && pNum.length == 10) {
var variables:URLVariables = new URLVariables();
variables.callerNumber = "1" + pNum;
variables.buttonId = "1234567890123456789012345678901234567890"; // I have my actual GV widget code in here //
variables.showCallerNumber = "1";
variables.name = fName;

var request:URLRequest = new URLRequest("https://clients4.google.com/voice/embed/webButtonConnect");
request.method = URLRequestMethod.POST;
request.data = variables;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
try{
loader.load(request);
}
catch (error:Error) {
trace("Unable to load URL");
}
gotoAndStop(3);
}
}

Any ideas?