Flash combines the operation of the database for the database

xiaoxiao2021-03-06  107

Flash combined with the ASP for a few days, because I am more lazy, I haven't read it now! First, you have to know some of the following knowledge! Will be a little ASP knowledge, know how to operate the database! Little flash knows, I know a little flash programming like it (I will do it in this area at a point)! Flash is to operate on the database is also using Flash to call the database query statement in your ASP file! Flash itself You can't operate the database! Let's take it with my wife's program! Let's get so complicated, take all the frames of this game! We have to do it, just finished After the witch, the points above the game are passed to the ASP. For example, how much money is playing in the rivers and lakes, how much physical strength, etc. So, you just find the frame of Gome over, loaded by a statement in Flash That ASP file is handled! Now let's take a look at this legend! There are two scenes in this game, the first is welcome, we omitted, the second is the master! Let's take a look at the MAINGAME scene under the background, The top has two virtual boxes this is the file box in Flash! It must be set into dynamic text boxes! People who have used my game know the number of witch that calculates to escape, when zero is Game over, the right side of Game over The score, we need to transfer the data in the right box to the file in the file in the ASP. This text box is called score (select this file box in the TEXT Options in the tab of the Ctrl T key in Flash. You can see this animation) This animation is very simple to have only four frames! See the figure below: The words with a A word is the programming code in it! Right tab is the text tab! The last frame is a gome frame Is the frame when the game is over, we need to call the ASP file in this frame! Let's see what is there! The fourth frame of the ActionS layer (that is, the fourth A) point button, the menu, choose Actions appeared in the programming box, see the picture loadvariablesnum ("out.asp", 0, "post"); this is the key, using the POST method in the flashvariablesnum in flash to pass the data to the ASP, POST method is like a form Like the data, it is as if there is a GET method in the ASP to receive a GET method. It doesn't need you to use the number in the upper left corner. There will be a tab. Figure: Select LoadVariables in Actions! Then he will have the following input box to enter the received parameters in the URL. The file selection Level in Location, I have some additional items on the Internet, I have a problem with the Flash version, I don't have any questions, I will choose another one by information when I am at home. The option is wrong, I have to get a night! Hey! Select send mode in Variables! You choose POST and do it! But choose POST to be relatively safe! After these completion, let's see the ASP file! I use It is Out.asp to see something inside <% rnds = int (Request.form ("RNDS")) IF rnds = session ("RNDS") THEN INFO = SESSION ("info") score = request.form "score") score = score * 20 set conn = server.createObject ("adodb.connection") set = server.createObject ("adoDb.recordset") Conn.open Application ("sjjh_usermdb") SQL = "Update User Set Silver two = silver two '"& score", physical strength = physical strength-500 where name =' "& info (0) &" 'and physical strength> = 500 "

转载请注明原文地址:https://www.9cbs.com/read-125263.html

New Post(0)