Flash XML Applications Use AS2 and AS3 to Create Photo Galleries, Menus, and Databases phần 7

Trong Phần 2 (Chương 14), chúng ta sẽ thêm các tính năng như lưu dữ liệu bằng cách sử dụng các đối tượng chia sẻ, chia màn hình thành các nhóm với các nút Next và Previous, và hiển thị các trang HTML để biết thêm thông tin. | Chapter 15 Content Management 18 If the variable action from the movie is defined as info we can proceed. Otherwise the process is terminated switch action case info addinfo sendXML contentXML break default fail Unknown action action In the function addinfo we open the file contentXML with the URL for the correct XML file. We give write permission by adding w function addinfo sendXML contentXML file fopen contentXML w If the file is not open we throw an error message. The correct execution of this function depends on the server. Many servers require a permission of777 for files to write in. if file fail Error Couldn t open xml file Otherwise we wr ite the new data into the file which will erase the former data. We then close and execute the success function fwrite file sendXML fclose file success If there were problems anywhere the fail function would be executed. function fail errorMsg echo result errorMsg exit If the process was successful we send the str ing Okay back to the movie which will trigger the onLoad event. We then exit function success 88 Flash XML Applications echo result Okay exit Deleting Nodes The DeleteNode Class Part of a CMS is not only to add items but also to delete what is not needed any more. In our case we want to be able to delete old nodes for houses that have been sold. What is the best way to do it The method that we use to delete nodes makes use of the id tag and the idMap property. Every house node has a unique id tag. Each id tag represents one whole node. However there is no simple delete method. Therefore we need to develop a strategy to delete the node without changing the whole XML file. There are two ways to delete the node. We could do it in the Flash movie and then send the new XML file to a PHP script on the server. Alternatively we could delete the node on the server. I have chosen the second possibility for no particular reason other than to show how you can do it. What in detail do we want to accomplish To select a node .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.