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/