tailieunhanh - O’Reilly Programming Flex 2 phần 9
Bạn có thể tìm thấy hoặc đăng tin những ứng dụng tuyệt nhất về Rich Internet Application tại . Website chuyên trưng bày, bình chọn, đánh giá và nhận xét những sản phẩm Rich Internet Application. Đó là những ứng dụng được phát triển từ Flex, Silverlight hay Lazlo (những công nghệ nóng hổi nhất hiện nay để tạo ra các ứng dụng giàu tính internet). | are controlled and managed entirely by Flash Player. These files are called local shared objects and you can use ActionScript to write to and read from these files. Flash Player uses the class to manage access to local shared object data. Although the data is stored in files on the client machine the access to those files is controlled exclusively through the SharedObject interface. This both simplifies working with shared objects and improves security to protect Flex application users from malicious programmers. Note that the SharedObject class also allows you to work with remote đ shared objects. For this reason you may notice that the SharedObject v ÍỊÃ class API includes many properties and methods not discussed in this chapter. Remote shared objects allow real-time data synchronization across many clients but they also require server software such as Flash Media Server. In this book we discuss local shared objects not remote shared objects. Creating Shared Objects Unlike many ActionScript classes the SharedObject constructor is never used directly and you cannot meaningfully create a new instance using the constructor. Rather the SharedObject class defines a static lazy instantiation factory method called getLocal . The getLocal method returns a SharedObject instance that acts as a proxy to a local shared object file on the client computer. There can obviously be many local shared objects on a client computer so you must specify the specific shared object you want to reference by passing a string parameter to getLocal . If the file does not yet exist Flash Player first creates the file and then opens it for reading and writing. If the file already exists Flash Player simply opens it for reading and writing. The following code retrieves a reference to a shared object called example var sharedObject SharedObject example Reading and Writing to Shared Objects Once you ve retrieved the reference to the shared object you
đang nạp các trang xem trước