2 Replies Latest reply on Feb 2, 2011 2:37 PM by learner_doug

    Spotlight Effect?

    learner_doug Level 1

      Does anyone know a way, or even a lead on a way to produce a "spotlight" effect that makes a rectangular area (textArea) of the screen normal, but darkens the rest of the screen?

       

      Thanks

        • 1. Re: Spotlight Effect?
          Shongrunden Adobe Employee

          Maybe try using a mask, for example:

           

          <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                         xmlns:s="library://ns.adobe.com/flex/spark">

           

              <s:Button label="big button" width="500" height="500" />

           

              <s:Rect width="500" height="500">

                  <s:fill>

                      <s:SolidColor color="black" alpha="0.5" />

                  </s:fill>

                  <s:mask>

                      <s:Group>

                          <s:Path data="M 200 200 L 300 200 L 300 300 L 200 300 L 200 200 Z M 0 0 L 0 500 L 500 500 L 500 0 L 0 0 Z">

                              <s:fill>

                                  <s:SolidColor color="blue" />

                              </s:fill>

                          </s:Path>

                      </s:Group>

                  </s:mask>

              </s:Rect>

           

          </s:Application>

          1 person found this helpful
          • 2. Re: Spotlight Effect?
            learner_doug Level 1

            Thanks for the sample code.