6 Replies Latest reply on Apr 29, 2010 6:07 AM by DennisTh

    loading transparent swf through swf REFdn3005773759

    DennisTh

      How to load a swf from another swf (I mean, from another AS code, not from html code), in order to be transparent? What properties should I have in loaded swf and how should I load it in order to be transparent?

       

      With word transparent, I mean, the color of the stage of the loaded swf must be transparent.

      Also, with this way of load, it is possible to play with “alpha” property?

        • 1. Re: loading transparent swf through swf REFdn3005773759
          Flex harUI Adobe Employee

          Use SWFLoader.  The loaded SWF does not have a stage color but if it draws a

          background that will still show.  You can use alpha as long as you have

          security permissions.

          • 2. Re: loading transparent swf through swf REFdn3005773759
            DennisTh Level 1

            Hi, thank you for your reply.

            I did it, I work now with SWFLoader, but the stage still remains not transparent. Bellow is the mxml code of the loaded swf.

             

            <?xml version="1.0" encoding="utf-8"?>

            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="598" height="200"  cornerRadius="20" >

              <mx:Image width="128" height="130" scaleContent="true" x="10" y="10">

                <mx:source>http://www.infodyn.com/images/info_invent_main_logo_300.jpg</mx:source>

              </mx:Image>

              <mx:Canvas x="146" y="10" width="444" height="180" backgroundColor="#646464" borderStyle="solid" borderThickness="3" borderColor="#CECECE">

                <mx:Label x="10" y="10" text="Info" fontFamily="Arial" fontSize="34" color="#BFBFBF"/>

                <mx:Label x="10" y="50" text="constructions" fontFamily="Arial" fontSize="18" color="#BFBFBF"/>

              </mx:Canvas>

            </mx:Application>

             

            I do not apply any background color (I think so). Note that the Canvas is a simple container that doesn't cover the whole stage!

             

            Here is the code where I load the swf:

             

                      aboutInfo = new SWFLoader();

                      aboutInfo.load("form_about_info.swf");

                      aboutInfo.alpha=50;

                      aboutInfo.addEventListener(MouseEvent.CLICK, HandleCloseAboutInfo);

                      mxmlApp.addChild(aboutInfo);

             

            The swf is loaded and appeared succefully but the its stage is not transparent.

            The "alpha" also didn't work at all!

             

            I am working Adobe Flex Builder 3, the colors of the Stage of the loaded swf is the default blue color. Where does this color defined?

             

            Best regards

            Dn

            • 3. Re: loading transparent swf through swf REFdn3005773759
              Flex harUI Adobe Employee

              mx:Application has some default backgrounds.  They are defined in the

              defaults.css file.

              • 4. Re: loading transparent swf through swf REFdn3005773759
                DennisTh Level 1

                Hi,

                 

                Let me remind you the point we are: We want to develop a swf with as Stage's color, the transparent color.

                 

                I found the follow "defaults.css" files (as you mention)

                 

                c:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\frameworks\projects\haloclassic\defaults.css

                c:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\frameworks\projects\framework\defaults.css

                c:\Program Files\Adobe\Flex Builder 3\sdks\3.2.0\frameworks\projects\airframework\defaults.css

                 

                I suppose that the "wanted" file is the 2nd; but which property should we change in order to make the swf with transparent Stage? (the "color" property doesn't effect).

                 

                There is no other way to make the Stage's color transparent? Editing the "defaults.css" I suppose that this will change the color of swf files.

                 

                I found that the color of the stage is changed with the "backgroundColor" property... so we can define the color here; but may we define the transparent color by someway?

                 

                Take care...

                • 6. Re: loading transparent swf through swf REFdn3005773759
                  DennisTh Level 1

                  amazing!!! still no answer...

                   

                  is it so difficult?