[Turn] MovieClip to bitmap method

Source: Internet
Author: User
Tags addchild

1 Package {2  ImportFlash.display.Bitmap;3  ImportFlash.display.BitmapData;4  ImportFlash.display.Loader;5  ImportFlash.display.LoaderInfo;6  ImportFlash.display.MovieClip;7  ImportFlash.display.Sprite;8  Importflash.display.StageAlign;9  Importflash.events.Event;Ten  Importflash.net.URLRequest; One  ImportFlash.system.System; A   Public classTestextendsSprite -  { -   PrivateConst FILE_PATH:STRING ="swf/2.swf"; the   PrivateConst CLASS_NAME:STRING ="Ball"; -    -   Private varLoader:loader; -   Private varrequest:urlrequest; +    -    Public functionTest () +   { ALoader =NewLoader (); atRequest =Newurlrequest (file_path); - Loader.contentLoaderInfo.addEventListener (Event.complete, oncomplete); - loader.load (request); -     This. stage.align=Stagealign.top_left; -     -   } in   Private functionOnComplete (event:event):void { -    varLoadedswfinfo:loaderinfo =Event.target as Loaderinfo;  to   +    varLOADEDSWF:MovieClip= Loadedswfinfo.content ASMovieClip; -     the Trace (loadedswf.framesloaded);  * loadedswf.stop (); $Loadedswf.x=0;Panax NotoginsengLoadedswf.y=0; -     This. AddChild (loadedswf); the Trace (system.totalmemory); +loadedswf.cacheasbitmap=true; A    //Loadedswf.getrect (); the    varBitmap:bitmapdata=NewBitmapData (loadedswf.width,loadedswf.height); +     -Loadedswf.gotoandstop (2); $ Bitmap.draw (loadedswf); $    varbb:bitmap=NewBitmap (Bitmap); -     This. AddChild (BB); -     This. RemoveChild (loadedswf); the Trace (system.totalmemory); -   }  Wuyi  } the}

Reprinted from: http://blog.sina.com.cn/s/blog_4c53883d0100a7jq.html

[Turn] MovieClip to bitmap method

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.