ForumsProgramming ForumSending information back and forth thru a GoDaddy server? (as2)

22 14911
mightybob
offline
mightybob
360 posts
Peasant

How could I send information, like x and y positions to a GoDaddy server, and also retrieve that information from another Flash Player in As2?

  • 22 Replies
weirdlike
offline
weirdlike
1,299 posts
Prince

HERE is a tut on peer to peer connections.

Maybe it will work for you just to get started

mightybob
offline
mightybob
360 posts
Peasant

Thanks for the reply I'll look at the tutorial!

mightybob
offline
mightybob
360 posts
Peasant

Ok sorry but looking at it I see I need to know a server port and a server name (I think?)... Any idea how I could figure this out? (I already have an up and running server)

mightybob
offline
mightybob
360 posts
Peasant

Sorry, triple post, but another question:

Is this code meant to connect to local server or a online one?

Plus it looks like it's as simple as saying "server.send(variable)", once it's all setup. So does this mean I could set a variable as a X and a Y position every frame, and then send that to the server every frame, and then also retrieve that info every frame from another flash player? If all that is possible then this tutorial is exactly what I'm looking for. Right now the tutorial seems a little vague on what everything means.

Like this part:

msg=""
server.send(msg)

I'm guessing the "login Nickname" is my username? And domainName since my server is called http://www.bobmania.com, I'd put that there? And then pass is my password for my account on godaddy? Or some other type of password? And I'm assuming once I've sent the "msg", then I'm logged in to send / receive whatever info I want?

Also is this where your domain restriction thingy comes into play, to protect people from getting all that info?

Okay this part I also will need some clearing up on:

server.connect("localhost", 2727)

So of course It's not a local server, so I need some other name. ( web adress maybe? like http://www.bobmania.com )

And how do I know the port?

Thanks again!

weirdlike
offline
weirdlike
1,299 posts
Prince

The tutorial is just to get you to establish the connection nothing more.

"localhost" is connecting your computer to itself

server.connect(URL, port)

scanning for open ports windows

mightybob
offline
mightybob
360 posts
Peasant

Ahh ok. So all I need is a port, a URL, and of course the server password username. Then the code just does the rest. Well, any ideas of how I could send information to it? Like variables? I've been googling for a while but can't find anything.

weirdlike
offline
weirdlike
1,299 posts
Prince

once you have made the connection you can send data via

msg="what ever you want"
server.send(msg);

mightybob
offline
mightybob
360 posts
Peasant

Well looked it up apparently this will eat up all my bandwidth, so I posted on the support forum, maybe there's an armorgames server they let people use.

If not maybe I could get a separate server for the game, so bandwidth isn't eaten up. Because my site is already slow enough, any more would be ridiculous.

mightybob
offline
mightybob
360 posts
Peasant

Oh and anyone who is going to do this but needs an open port (mac) there's a pretty cool built in app called Network Utility, on the far right there's a port scan, takes a few mins but it works!

mightybob
offline
mightybob
360 posts
Peasant

Found out how I could do this without hogging bandwidth, If i sent just numbers, like var numbers, then I could do this!

But I used the code and it doesn't work... I am very confused by it because this is my first time doing server connection. I keep searching google "as2 server connection" and a few other variations, but I never see anything like you found. Pretty sure I filled everything out right...

weirdlike
offline
weirdlike
1,299 posts
Prince

Did you already create the XML data and upload to the server? Or are you approaching localHost?

mightybob
offline
mightybob
360 posts
Peasant

Uhh no I didn't create an XML data, is there more pages to that tutorial?

mightybob
offline
mightybob
360 posts
Peasant

I know completely nothing about XML, i'll try to look that up.

mightybob
offline
mightybob
360 posts
Peasant

Yeah I'm gonna need some help on the XML part.

weirdlike
offline
weirdlike
1,299 posts
Prince

THIS site claims "Everything you need to know to start using XML in Flash ActionScript"

I really don't know anything about godaddy. The XML would be the bridge that would hold all the data on the server side (ex. logging into the game via username and pass), It would have nothing to do with logging into your godaddy account.

I suggest focusing on peer to peer and eliminate the godaddy route, or using XML, if you haven't done it before but want to see fast results

THIS guy, altho it's in as3, breaks down each portion of P2P really well, and gives .fla, the code is in the actions panel.

Showing 1-15 of 22