Need help with this.. SIRKENT!!! HELP!!!

This is a discussion on "Need help with this.. SIRKENT!!! HELP!!!" within the Flash & Multimedia Forum section. This forum, and the thread "Need help with this.. SIRKENT!!! HELP!!! are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 25th, 2003, 07:13
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Need help with this.. SIRKENT!!! HELP!!!

Ok, this is the thing I am facing. go to www.lordsoflegend.com there you will find a site with a game on it. Me and my buddies have created a site that will do the same thing... only we want to make it More interactive. So far, I have 2 graphic artists, 2 programmers, and 1 financial advisor.. Here's my problem, not a one of them knows anything about Flash, yet... they want me to create a flash game that Lets you attack an enemy based on your stats stored to the server. I can create the flash part of it easily, but what I don't know how to do is to get the flash file to read off a server and limit the number of lives and ammo based off of the variables you have stored in the server... Also, I need to know how I can send the score to the server. A detailed explanation is not needed, I just need to know what I need to learn to accomplish this task. I have a large word file of the game that explains it, but its very confusing unless you understand the game's layout. Thanks for your help, and even if your not Sirkent I would appreciate your reply!!!

  #2 (permalink)  
Old Oct 25th, 2003, 07:23
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
what I don't know how to do is to get the flash file to read off a server and limit the number of lives and ammo based off of the variables you have stored in the server..

I don't understand what you mean here ... maybe you can elaborate? I think I get the rough idea and I'll try to help if I can :wink:
  #3 (permalink)  
Old Oct 25th, 2003, 07:26
Reputable Member
Join Date: Aug 2003
Location: Singapore
Posts: 321
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gwx03
I do know how to do it * roughly * with PHP though, based on a web tutorial somewhere. There's not much info on these on the net when I last searched a month ago. I can give you the rough idea but I'm a newbie in making php and flash talk. I do know how to load variables and change variables though
  #4 (permalink)  
Old Oct 25th, 2003, 08:22
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Well... as for changing the variables and stuff I have that all down, I can even use cookies to carry variables over pages, but I want to somehow send the information from the game to the server.

Whats going to happen is you have to buy things in a store. I am going to create the store in flash, but you have only so much money. So I need to load that variable into Flash so you can't go crazy. I know it is possible becuase I have heard about it before. Also, I need to send the information to the server to add the new item and take off the amount of gold your spent.

The next thing I am looking to do with this, is what we call Attacking Turns. Every do often you will earn 1-2 attacking credits. Every weapon requires a different number. Lets say you only have 1 attacking credit. Well.. I want the flash movie to read the server and see that you only have 1 left, so that it won't let you go to the scene that will let you use a weapon that will use more than 1 attack credit. But after you attack, I need it to make you send the information back to the server.

Thats what we are trying to do with it, but are stuck for the moment. Thanks
  #5 (permalink)  
Old Oct 25th, 2003, 09:03
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
The best way to communicate to/from a server is to have some scripts on your server written in ASP/PHP/JSP/CGI whatever you want!! They can query a database or text file to append, access, store your data.

Flash can make queries just like a webform can. It can use both GET (putting the data after the page name using ?variable=value&variable2=value2 ) and flash can also use the POST method to send the data just like a form does, direct to the server.

Flash can also use sockets, etc, etc to be more secure and technical but let's not go there as it's difficult to get a cheap server-side solution for that!

In flash you can use ACTIONS>Browser/Network>loadVariables in actionscript which gives you:

Code: Select all
loadVariables("page.php", "_root.server_return", "POST");
where:
page.php is the page you are sending the variables to.
_root.server_return is where you want the variables to be sent when you recieve a reply. (the movie clip server_return in the root of the file).
POST is the method you're using.

It's best to put this in its own special movieclip, under a function. This way you can put the variables you want to send into that clip (as you rarely want to send all the variables in your flash movie - as they're not needed and it'll slow sending down) ss it will send ALL the local variables using this.

Hope this points you in the right direction?
  #6 (permalink)  
Old Oct 25th, 2003, 09:05
Highly Reputable Member
Join Date: Aug 2003
Location: Australia
Posts: 662
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks Sirkent. This really helps out a lot. At least now I have somewhere to start from.
  #7 (permalink)  
Old Oct 25th, 2003, 09:17
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
Ok, Kulegamr asked me if this would let a PHP programmer know exactly what to do?

Well no. He would be receiving the variables from flash in a way which he could use with no problems!! Any PHP programmer knows you can use

Code: Select all
$HTTP_POST_VARS[variableName];
to get POST values and GET instead of post to get GET values :razz:

But it's how you return variables to flash that's different.

Through the loadVariables method, flash uses its own variable definitions:

&variablename=variablevalue&variablename2=variable value2... etc etc

You can have as many variables with whatever name and as long as they start with & they will be treated as a variable. You can use spaces for your variable values (technically you could pass an entire book's worth of information. Obviously you CAN'T use the "&" character. It has to be converted to it's UNICODE or HTMLcharacter style, which flash can then use a function to interpret (which you can find in the library or ask me about later). But of course if your server is not returning user-defined variables, like messages, then you won't need that...

Please also not:
The advantages of using a movieclip to store your server-returned variables in, is that you can use onClipEvent (data) to make a movieclip automatic perform actions when the data is returned!

onClipEvent (data) {
// do something
}

Otherwise how would you know when the data has loaded? You *can* use a loop to check when a new variable is set, over and over again, but it uses more resources than a simple listener, like above.

Hope that helps too!
Closed Thread

Tags
help, sirkent

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
The real Sirkent.... Image Created by me... courtjester Graphics and 3D 30 Apr 13th, 2004 16:07
Photoshop Tennis - Billydakid Vs Sirkent Round 2 Webforumz Staff Graphics and 3D 8 Feb 12th, 2004 22:22
Photoshop Tennis - Billydakid Vs Sirkent Round 1 Webforumz Staff Graphics and 3D 4 Feb 11th, 2004 07:24
Photoshop Tennis Match 1 - Billydakid Vs Sirkent Webforumz Staff Graphics and 3D 13 Feb 10th, 2004 16:22
Sirkent, This should be easy for you! courtjester Flash & Multimedia Forum 4 Nov 14th, 2003 22:36


All times are GMT. The time now is 19:56.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43