Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Foundation Flash CS4 for Designers- P21: I can remember the day as clear as if it were just yesterday. I was walking by my boss’s office late one winter afternoon at the college where I teach, and he called me into his office. Sitting on his desk was a thin, white box with some sort of weird swirl on it. He slid the box across to me and asked, “You know anything about Flash?” | CHAPTER 14 14. To simulate image downloads so you can see the progress bar in action select View Simulate Download from the SWF s File menu. If you like compare your work with the Slideshow.fla file in the Complete folder. Extending the tour As it turns out wandering through the 798 Art District of Beijing makes a decent metaphor for this exercise because after all of this careful examination of the art in the galleries we re about to uncover a treasure in a gallery just a few more paces up the street. Save your file to keep everything safe. Now select File Save As and save a copy as SlideshowXML.tla into the same folder. Click back into frame 1 of the scripts layer to make a few changes. Here s the first chunk of code which replaces the hard-wired images with revisions shown in bold. import fl.data.DataProvider var xmlDoc XML new XML var xmlLoader URLLoader new URLLoader var xmlReq URLRequest new URLRequest slideshow.xml xmlLoader.load xmlReq xmlLoader.addEventListener Event.COMPLETE xmlCompleteHandler function xmlCompleteHandler evt Event void xmlDoc XML evt.target.data images.dataProvider new DataProvider xmlDoc changePicture o The imageData array is gone completely. In its place stands our trusty XML loading formula. The only differences here are the variable names. The URLLoader instance for example has been changed to xmlLoader because loader is already in use as the instance name for the UILoader component. In the same way the URLRequest instance is named xmlReq because req is used later in the code and the XML s completeHandler function is named xmlCompleteHandler . This time we re loading the file slideshow.xml and that s where the former imageData content now resides. Translated into XML it looks like this slideshow slide label 798 Art District Photo 1 data 798_01.jpg caption Lazy day on the street. slide label 798 Art District Photo 2 data 798_O2.jpg caption Wall art. slide label 798 Art District Photo 3 data 798_O3.jpg caption Angry and cute. slide .