Trig projection problem

I’ve been working with ActionScript a little while, and I’m trying to figure out how to do basic trigonometric projections. I’ve been following a tutorial at metanet.com, and I can’t seem to get it implemented correctly.

What I have is the attachment.

Please reply.