Flex uses a pop-up form to display GIF images

Source: Internet
Author: User

GIF player is used to display GIF images in flex.

 

Class Library Website

Http://www.bytearray.org /? P = 95

Code Acquisition website

Http://code.google.com/p/as3gif/

 

Environment: flex4 + gifplayer0.6

 

1. Download The GIF player source code to the project.

2. Create loadingview. mxml

-------------------------------------------

<? XML version = "1.0" encoding = "UTF-8"?>
<S: titlewindow xmlns: FX = "http://ns.adobe.com/mxml/2009"
Xmlns: S = "Library: // ns.adobe.com/flex/spark"
Xmlns: MX = "Library: // ns.adobe.com/flex/mx"
Width = "180" Height = "88"
Creationcomplete = "Init ()"
Title = "loading... please wait... "Enabled =" true ">
<S: layout>
<S: basiclayout/>
</S: layout>
<FX: declarations>
<! -- Place non-visual elements (such as services and value objects) Here -->
</FX: declarations>
<FX: SCRIPT>
<! [CDATA [
Import org.bytearray.gif. Player. gifplayer;


Public var mygifplayer: gifplayer = new gifplayer (true );

Public Function Init (): void {
// Hide the close button
This. closebutton. Visible = false;
// GIF image path
VaR request: URLRequest = new URLRequest ("styles/loading/loadingimage4.gif ");
// Gifplayer loads the image
Mygifplayer. Load (request );
Mygifplayer. Visible = true;
// Bind the image to gifplayer
IMG. addchild (mygifplayer );
}


]>
</FX: SCRIPT>
<Mx: Image id = "IMG" width = "50" Height = "50" x = "66" Y = "3">

</MX: Image>
</S: titlewindow>

 

3. Call

Private var window: loadingview;

Window = new loadingview ();
Popupmanager. addpopup (window, this, true );
Popupmanager. centerpopup (window );

 

4. Remove

Popupmanager. removepopup (window );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.