Hey all,
Still working on a series of games and ran into a problem with uploading from AS3 to Twitter.
What I want to happen is the player enters their name at the start of the game. When the player completes the game their time and name are sent to Twitter to be posted.
The code for the timer handler:
function TimerHandler(e:TimerEvent):void{
var TotalCounts:uint = MyTimer.currentCount+penalty*10;
var Seconds:String = String(uint(TotalCounts%60));
var Minutes:String = String(uint((TotalCounts/60)%60))
var Hours:String = String(uint((TotalCounts/60)/60));
SecondText.text = (uint(Seconds)< 10) ? "0" + Seconds:Seconds;
MinuteText.text = (uint(Minutes)< 10) ? "0" + Minutes:Minutes;
HourText.text = (uint(Hours) < 10) ? "0" + Hours:Hours;
}
The code I have to send info to Twitter:
navigateToURL(new URLRequest('http://twitter.com/home?status='+encodeURIComponent('INPUT NAME completed '+"Art Colour Mixing Game"+' and finished in a time of '+Hours+''+Minutes+''+Seconds+'')),'_blank');
What I get back from Twitter:
INPUT NAME completed the Art Colour Mixing Game and finished in a time of 0undefinedundefined
Sorry if this makes little sense please let me know if you can’t understand.