go go google gadgets February 17, 2008
Posted by headwinds in iGoogle.add a comment
So yeah its saturday, and I’m stuck in except we have a new civic holiday “family day” on monday which means tomorrow night is really saturday. I’m off to catch Fabio at Footwork… no not THE Fabio… the drum n bass dj who probably isn’t as lucky with the ladies unless behind the decks.
FREE PYSCHONAUNTS
If you play PC games and haven’t tried Gametap yet, you’re missing out. There are lots of free games to try including Tim Schafer’s classic Psychonaunts — also check out his studio Double fine, which has one fantastic logo, and a hardcore project in the works:

Brutal Legend!!! where the heroes are head-bangers and their weapon of choice is an axe of course.
iGOOGLE GADGETS (FLASH AND JAVASCRIPT)
I’ve just spent a couple hours working out how iGoogle gadgets can be built with Flash(AS3) and Javasciprt. Getting Flash to show up was relatively easy compared to getting Flash and Javascript to talk to each other. Flash kept throwing a securityError #2060 when the Flash and Javascript were contained on the same page within the cdata block between the content tags.
Instead of the html type, use the the url type and host your own html container that combines the Flash, Javascript, and PHP scripts.
Flash and Javascript can now securely call each other
Also if you’re using the GGE (Google Gadget Editor) and followed their instructions to upload content in their environment but couldn’t figure where it went after uploading — perhaps, i’m only the one who missed this but if not — here’s an illustration to help you out which i wish i had a half hour ago — the instructions say right hand side but its actually on the left.
GADGET RESOURCES
Godaddy SQL Server 2005 C# February 2, 2008
Posted by headwinds in ASP.NET, Actionscript, SQL Server.2 comments

for some odd reason, I woke up at 6:30 this morning on a mission to crack my .Net connection. Perhaps, it had something to do with watching the latest episode of Lost (S4e1) and the classic Quadrophenia last night.
I consider myself a beginner with ASP.NET and SQL Server 2005 but I’ve had some experience mining databases with PHP and MySQL. I’m an expert in Flash actionscript though, and have heard great things about C# being very similar in syntax to AS3. I’ve also worked at 2 large .NET shops (Eloqua and Navantis) working closely with .NET developers on Flash/.NET integrations, and drank too much of their kool-aid. Also, at Push, our lead back-end developer, Mark Aucoin, is quite the .Net pusher.

I’d like to offer a very brief tutorial [pretty much just the configuration scripts which I found extremely hard to find
] about what to do after you’ve setup your SQL Server 2005 database from your Godaddy admin panel — Godaddy provides adequate help about how to do this but seems to be missing this solution or at least I couldn’t find it.
Goal: to create a webservice so that Flash (AS 3) can talk to ASP.NET and SQL Server.
You basically need to create these 2 files:
// web.config
//—————————————————
<configuration>
<appSettings>
<add key=”ConnectionInfo” value=”server=yourserver; uid=yourusename; pwd=yourpassword; database=yourdatabase;” />
</configuration>
</appSettings>
//————————————————–
// WebService.asmx
//—————————————————
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Data;
using System.Diagnostics;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
[WebService(Namespace = "http://www.headwinds.net/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebService : System.Web.Services.WebService
{
[WebMethod]
public DataSet GetCarbonQuizTable()
{
SqlConnection Con;
string sSQL;
// its recommended that you put your connection string in your web config file but I’ll show you an alternative:
//sConstring=”user id=yourid; password=yourpassword;database=yourdatabase;server=yourserver”;
// ["ConnectionInfo"] <— square brackets — very important
string sConstring = ConfigurationSettings.AppSettings["ConnectionInfo"];
// you can add complex sql here but for this tutorial I’m just going to return the entire table
// once you’ve mastered this you can progress to stored procedures and views
sSQL = “select * from YourTableName”;
Con = new SqlConnection(sConstring);
DataSet ds = new DataSet();
Con.Open();
SqlDataAdapter da = new SqlDataAdapter(sSQL, Con);
da.Fill(ds, “CarbonQuiz”);
return ds;
}
}
//—————————————————
Once you’ve configured these files to match your credentials, you upload both of them to the root of your hosting account. You can test the WebService.asmx by opening it in a browser.
Next, you can see the results in Flash CS3.
//TestWebservice.fla
//—————————————————
import alducente.services.WebService;
import flash.events.*;
var ws:WebService = new WebService();
ws.addEventListener(Event.CONNECT, connected);
ws.connect(“http://www.headwinds.net/WebService.asmx?WSDL”); // enter the path to your webservice here
ws.cacheResults = true;
var initTime:Number;
//Once connected, call an available method on the service named “ResolveIP” with the appropriate parameters
function connected(e:Event):void
{
trace (“CONNECTED!”);
ws.GetCarbonQuizTable(onComplete);
}
//This function is called when there is a response from the sesrvice
function onComplete(serviceRespone:XML):void{
trace(“\nWeb Service Result: “);
var time:Number = getTimer();
trace(“Call duration: “+(time – initTime)+” milliseconds”);
initTime = time;
trace(serviceRespone);
}
//—————————————————
RESOURCES
a decent read
programming C# from O’Reilly
GOFR – Flash AS3 webservice package by Carlo Aducente
I highly recommend the following series especially #8 — big eureka moment for me when it all comes together.
SQL ASP.NET Tutorials
the above are free, you can also get 500 more for $49 from here:
www.learnvisualstudio.net
line physics February 1, 2008
Posted by headwinds in Gaming.4 comments

A few days ago, I ported Emanuele’s AS2 line rider tutorial to AS3 in about an hour, and then went on to add keyboard control and gave him a grenade launcher — I’m not going to include the source in this post because it was fun to port
and don’t want you to miss out. Its amazing how fast one can knock together a Metal Slug prototype these days.
For our game [stay tuned], I needed to change a few things such as moving the terrain and not Manny so that he stays locked to the centre of the screen; giving the illusion that he’s actually moving — this prevents him from sliding off the screen.
I’ve been been experimenting with different collision detection techniques (hitTestPoint, using circles, and even colour getPixel), and found Keith Peter’s book invaluable; especially the relatively simple radius detection (compared to the vector stuff) — great introduction to trig and physics — I wish he was my highschool math teacher. I’ve learned that switching between different techniques can increase performance dramatically.
RESOURCES
Line Rider
HIVE Keyboard Manager
Line Rider Tutorial by Emanuele Feronato
Actionscript 3.0 Animation by Keith Peters
* update Aug.19/2009 — see comments — I was encouraged to dig up and post the source *
