4 Replies Latest reply on Aug 11, 2010 4:59 AM by Flex Rock

    Give mouseover effect to external swf

    Flex Rock Level 1

      Hi,

          I am loading swfs in my flex application. I need to give mouse over effect to those swfs.Please give me sample code.

       

      Thanks

      Jayagopal.

        • 1. Re: Give mouseover effect to external swf
          BhaskerChari Level 4

          Hi Jayagopal,

           

          What mouseOver effect do you want to apply..??

           

          Do you want to apply it on the whole swf file or only some of the controls within the SWF file..?

           

          Are you loading Flash SWF files..??

           

           

          Please make things clear...

           

           

          Regards,

          Bhasker Chari

          • 2. Re: Give mouseover effect to external swf
            Flex Rock Level 1

            Hi Basker Chari,

                                    I need effects like button has. Something like when we bring the mouse onto a button it will glow. The same effect i am expecting.

             

            I need to apply it to full swf.

             

            I am loading flash swf files.

             

            Regards,

            Jayagopal.

            • 3. Re: Give mouseover effect to external swf
              BhaskerChari Level 4

              Hi Jayagopal,

               

              Check the code below...

               

              Please make sure assets/flashswf.swf is presnt in your project..

               

              <?xml version="1.0" encoding="utf-8"?>
              <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
              layout="vertical"
              backgroundAlpha="0"
              backgroundColor="#FFFFFF"
              creationComplete="init()">
              <mx:Script>
                <![CDATA[
                 import mx.controls.Alert;
                
                 private var timer:Timer = new Timer(1000, 2);
                
                 private function init():void
                 {
                  glowImage.target = swfLoader;
                  unglowImage.target = swfLoader;
                 }
                 public function onSWFLoadComplete():void {
                  Alert.show("SWFLoadComplete");
                 }
                ]]>
              </mx:Script>
              <mx:Canvas>
                <mx:SWFLoader id="swfLoader" mouseOver="glowImage.play();" mouseOut="unglowImage.play();" source="assets/flashswf.swf" complete="onSWFLoadComplete();"/>
              </mx:Canvas>
              <mx:Glow id="glowImage"
                      alphaFrom="1.0" alphaTo="0.3"
                      blurXFrom="0.0" blurXTo="50.0"
                      blurYFrom="0.0" blurYTo="50.0"
                      color="green" duration="1000"/>
                  <mx:Glow id="unglowImage" duration="1000"
                      alphaFrom="0.3" alphaTo="1.0"
                      blurXFrom="50.0" blurXTo="0.0"
                      blurYFrom="50.0" blurYTo="0.0"
                      color="green"/>
              </mx:Application>

               

              If this post answers your question or helps, please kindly mark it as such.


              Thanks,

              Bhasker Chari

              • 4. Re: Give mouseover effect to external swf
                Flex Rock Level 1

                Thanks for your reply this is what i am expecting.

                 

                Thanks & Regards,

                Jayagopal.