Solved the problem of movieclip thumbnails.

Source: Internet
Author: User

The movieclip thumbnail problem has just been solved. below is my:

 

The red section below is the key to modifying and adding thumbnails.Code.

Modify pages. mxml

Modify and add:

Private function createpages (Event: Event): void
{
VaR MC: movieclip = application. application. libmc;

For (var I: Int = 1; I <= mc. totalframes; I ++)
{
Box = new page ();
MC. gotoandstop (I );
VaR bitimage: bitmapdata = new bitmapdata (MC. Width, MC. Height );

VaR M: matrix = new matrix ();
Bitimage. Draw (MC, M );

// The key is to convert bitmapdata into a bitmap object before binding it to the image control.
VaR mymap: bitmap = new Bitmap (bitimage );

Box. mapdata = mymap;
Box. pagenumber = I;
Addchild (box );
Box. addeventlistener (mouseevent. Click, dispatchpage );
}
// Return to the first frame
MC. gotoandstop (1 );
}

 

Modify page. mxml

Added:

[Bindable] private var mymap: bitmap;

Public Function set mapdata (value: Bitmap): void {
Mymap = value;
}

<Mx: Image id = "clipimage" Source = "{mymap}" width = "100%" Height = "100%" horizontalalign = "center" verticalalign = "Middle"/>

 

In my movieclip implementation, I mainly refer to the online materials. I would like to share them with other users and thank you for your reference.ArticleThe work of the authors.

References:

Flex: http://fykyx521.javaeye.com/blog/432113

Flex saves the canvas class to upload images to the J2EE server: http://hi.baidu.com/onlylamplight/blog/item/e9b5534511611288b2b7dcae.html

In Flex, bytearray and bitmapdata are used to convert each other to achieve binary preservation and restoration of images: http://hjy2099.javaeye.com/blog/260329

ActionScript 3 JPEG encoder revealed: saving images from FLASH: http://designreviver.com/tutorials/actionscript-3-jpeg-encoder-revealed-saving-images-from-flash/

 

 

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.