Do you need Flash Remoting?

xiaoxiao2021-03-06  79

After Flash MX is launched, Macromedia actively launched a lot of food related to flash, with DRK, Flash Remoting, Flashcom, Data Connecton Kit, is coming to Central and Royale ... where the Maximum Flash player is confused is Flash Remoting and Data Connecton. Kit, what is the use? What is the difference between the two? I have only used Flash Remoting, DCK, and its firefly component still have not had a chance to get the test version, so I can only talk about the use of Flash Remoting.

Simply put, both are used to make Flash and Server easier to exchange Data, query Database, etc. If only use flash to make animations, stand-alone games, demo interfaces, do not contact Server work, do not need flash recoting And DCK. Background Information Since FLASH 4, Flash can connect to Server to exchange data. The method is to use loadvariable () to connect Middleware, server-side program, ie ASP, PHP, etc., flash and post pass Data to Middleware, and traditional HTML FORM is the same. MiddleWare is transferred to flash in url-encoded format, which print, echo, response.write (Sytnax is based on what server-side program), for example:

MyName = Luar & Place = hong kong

The disadvantage of loadvariable () is that Variable can only be one by one, and Flash will receive all the Variable's Data Type is all considered to be String (Number is no exception). If you want to pass a series of Variables, you only:

VAR1 = 123 & var2 = 456 & var3 = 789 ...

or:

VAR = 123 | 456 | 789 ...

Then you open it yourself, Flash 4 doesn't have array and split (), which is a very painful job. Meet the number of Dynamic's number of variables, but also rely on MiddleWare to represent the total number of variable, which is convenient to open the Data.

Flash 5 supports Array and Split (), which can be dismantled with Split (), but split () is very slow, and the Branden Hall wrote SPLIT. () Perform speed.

Loadvariable () Another problem is an asynchronous delay, Flash does not know when DATA has already entered it, so the novice often calls the variable, and the problem is that the solution is to pass back the String head. BOF = 1 and EOF = 1, for example:

BOF = 1 & myname = Luar & Place = hong kong & eof = 1

Then use the two-grid frame to stop playback, check whether BOF and EOF are equal to 1, for example:

[Frame 1] Loadvariable ("Var.php", 0);

[Frame 2] IF (BOF == 1 and EOF == 1) {gotoandplay (4);} [frame 3] gotoandplay (2);

[Frame 4] Trace ("DATA IS Loaded!");

When the XML era wants to pass a large amount of related data, when the Database Table section Recordset is used, it is not easy to use the uncomfortable array method. Fortunately, Flash 5 starts supporting XML, making the incoming DATA more system, for example:

Hong Kong Kelly Kowloon

Xml.onLoad makes flash know that Data is already load, you can start XML PARSING, which means to transfer Data Type in XML to Flash, usually transferred into array, but XML Parsing is converted to array, array element Data Type is only String.

Flash 5 processes XML very slow, widely ill, encountered a large number of DATAs, such as 10K or more, XML Parsing even dragged Flash Player, then Branden Hall wrote XMLnitro optimized XML Parsing execution speed. However, sometimes I would rather use back to Loadvariable and demolish the Array method, simpler, convenient and fast.

Flash 6 New Flash Flaser 6 When performing Flash 5/6 file, the speed of Array and XML Pars is a lot of speed, but Data Type is still string, and the Loadvariable () is not synchronized, Flash 6 joins Loadvars Object, Use it to handle the work of Data and Server, which is very convenient, loadvars.onload makes Flash know that DATA has been loaded.

XML SocketFlash 5 added XML Socket, actually by the Socket Server, which is running, active Push Data, which is mainly used to make Multiuser applications, or stock instant offer. Macromedia does not have a Socket Server, write one yourself, or write Socket Server written by others (for example, unity, electroserver et al.), Socket Server is always running, receive DATA. Ordinary Hosting is not necessarily Run Server, and in Flash and Server exchange DATA, you should rely on Socket Server again, usually use in daily development work.

Flash Remoting has a big pile background information, just wants Flash Remoting to be born with the above questions, I think Flash Remoting has 2 main features: Different Data Types directly with Server, connect Remote Services.

Data Type from Server to Flash is String, and the DATA TYPE that is transmitted from Flash to Server is string, flash recitaling can directly pass Number, Boolean, Array, etc., which can be passed between Flash and Server, which can be reduced. The workload of the two ends of Client and Server in Data Type conversion. For example, Server can pass Data directly to Flash, Flash can be used immediately, it is very convenient; even the entire RecordSet is passed to flash, and it is displayed in conjunction with Data Grid. In addition, the most important is that ActionScript using Flash Remoting in Flash is NetServices, which has two states_status and _Result. _Status is used to handle Exception, such as delivery failure, etc., _Result is used to handle successful transfer. So on the Data delivery, flash recoting allows Flash to fully master the entire process. The second function I think the impact is far-reaching because it allows Flash and network technology to connect to Web Services. Before there is no XML, the data format is different for politics, different technologies, and producers are different. Even if the real work, the procedures, processing, storage, or output formats made by the same companies, different departments are different, so they are made in DATA interoperability. Very big trouble, use people's DATA, you must write an interpretation program. However, after XML, add the SOAP communication protocol, and different programs can be exchanged with XML to exchange Data. In other words, the program output result is an XML format, and other programs can "understand" it. Internet is the largest exchange of Data, Web Services is a remote computer, and other computers can be connected.

The impact of Web Services is simply that Flash Remoting enables Flash to connect to places outside of Domain, deliver DATA, break through the safety restrictions of Sandbox themselves. On weekdays, the Web Based application developed in the week, the DATA (URL-Encoded format) from Server is basically tailoring for Flash, even XML, in order to reduce XML Parsing load, XML is streamlined Only DATA, other programs do not need these DATAs, is wasting development time and resources, reducing the ability to exchange DATA, change the web based program in web services, Flash can be used by Flash Remoting, other programs can be used with WSDL I know how to use it, just now is currently circulating, and the development procedure has a big trend of more reusability and expansion.

Summary When you know how the program is positioned, if you ask for Flash and Server Data exchange, or you will understand if Flash Remoting is required. As a single ActionScripter, only Write ActionScript, there is no Server-Side programming capability, it is basically difficult to use Flash Remoting, because flash recoting is very simple on Flash, as long as it is responsible for flash recitaling, pointing, pointing out what service Waiting for the reception of DATA, server-side programming is the skill, so it is necessary to become a comprehensive Flash Developer, you should learn a Server-Side Program, you can choose ColdFusion, ASP.NET, or PHP. This article is published by Luar

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

New Post(0)