Using as program to apply projections to semitransparent images

Source: Internet
Author: User

Create a new Flash document and save it as a dropshadowtransparent.fla.
Add the following ActionScript to frame 1th of the timeline: import Flash.filters.DropShadowFilter;

The code is as follows Copy Code Domain ("");
var mcllistener:object = new Object ();
Mcllistener.onloadinit = function (target_mc:movieclip): Void {
    target_mc._x = (Stage.width- Target_mc._width)/2;
    target_mc._y = (stage.height-target_mc._height)/2;
    var dropshadow:dropshadowfilter = new Dropshadowfilter (4, 0x000000, 0.5, 10, 10, 2, 3);
    target_mc.filters = [DropShadow];
Mcllistener.onloaderror = function (target_mc:movieclip): Void {
    trace ("Unable to load image.") ;
This.createemptymovieclip ("LOGO_MC", 10);
var my_mcl:moviecliploader = new Moviecliploader ();
My_mcl.addlistener (Mcllistener);
My_mcl.loadclip ("/images/logo.png", LOGO_MC);

This ActionScript code uses the Moviecliploader class to load an image and applies a drop shadow filter when the image is loaded from the remote server.

Select Control > Test movie to test the Flash document.

Flash uses a transparent background to load the PNG image. When you apply a drop shadow filter, only the opaque part of the image applies the filter.

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: 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.