2 Replies Latest reply on Apr 24, 2006 11:20 AM by Newsgroup_User

    dynamic drop shadow

    Level 7
      Does anyone know how to create a dynamic drop shadow?

      It's accessed using the dropshadown method on the flash.filters.

      var myDropFilter = new flash.filters.DropShadowFilter();

      Ok, but how the heck to work it?

      The reason is that I've created a fully XML dynamic drop down menu
      system (looks awesome), and the movie clips are not on stage or in the
      lib, so I have to create the MC and add filters too it.

      Anyone do this yet?

      Thanks

      -Richard
        • 1. Re: dynamic drop shadow
          shyaway Level 1
          from Flash help:

          public DropShadowFilter([distance:Number], [angle:Number], [color:Number], [alpha:Number], [blurX:Number], [blurY:Number], [strength:Number], [quality:Number], [inner:Boolean], [knockout:Boolean], [hideObject:Boolean])

          press F1 in flash for more details. it explains how to use it pretty clear.
          • 2. Re: dynamic drop shadow
            Level 7
            Richard Ragon wrote:

            > Does anyone know how to create a dynamic drop shadow?
            >
            > It's accessed using the dropshadown method on the flash.filters.
            >
            > var myDropFilter = new flash.filters.DropShadowFilter();
            >
            > Ok, but how the heck to work it?
            >
            > The reason is that I've created a fully XML dynamic drop down menu
            > system (looks awesome), and the movie clips are not on stage or in the
            > lib, so I have to create the MC and add filters too it.
            >
            > Anyone do this yet?
            >
            > Thanks
            >
            > -Richard


            Ok, heres a first.. I just answered my own question.. With some
            digging, I was able to find an example, that helps me out understand it.

            So, here it is if anyone wants to know...

            first you have to place in the import

            import flash.filters.DropShadowFilter;


            Next you need to create a new dropshadowfilter object like this..


            var myDropFilter ropShadowFilter = new DropShadowFilter(3, 45,
            0x000000, .5, 5, 5, 1.5, 1, false, false, false);


            I added in some settings already.

            1- Distance
            2- Angle
            3- Color
            4- Alpha (ex: .5 == 50%)
            5- BlurX
            6- BlurY
            7- Strenght (ex: 1.5 == 150%)
            8- Quality (ex: 1 == low)
            9- Knockout
            10- Inner shadow
            11- Hide Object

            Next, create an array to hold your filters in, and push the new
            Dropshadowfilter object into it..


            var filterArray:Array = new Array();
            filterArray.push(myDropFilter);


            Next, I have my code create the menus with a function


            function makeNewSubMenu(myMenu, myDepth, myPOS_x, myPOS_y):Void {
            _root.drops.attachMovie("Drop_Down_MC", myMenu,
            _root.drops.getNextHighestDepth(), {_x:myPOS_x, _y:myPOS_y});
            // create a dropshadow
            _root.drops[myMenu].filters = filterArray;
            };


            You'll notice that the very last line drops the filterArray created
            earlier into the new dynamic Menu, using the .filter method.

            Works like a charm!

            I can imagine there's some kewl things that you can do with this dynamic
            dropshadow creation stuff.. Hope this helps some else looking into this
            new stuff!!

            Good luck

            -Richard