6 Replies Latest reply on Jul 14, 2009 6:23 PM by rfrishbe

    how to bring in a swc ?

    Level 2

      i want to bring in FLVPlayback.swc and .AS


      to the library path, i added the swc, i added the directory containing fl and below folders for the .AS file(s).


      the import stmt and the object =new FLVPlayback();  works, but when i do an addChild() it says that i must use addElement or perform skinning. addElement dies on implicit conversion.


      so, can SWC's be dragged and dropped with the designer or only thru code, any thoughts.


      as for why, just a test to see how to bring in swc's, plus the current VideoPlayer is a bit flakey. i have a lot from flash cs4 I want to bring in, custom UI objects.

        • 1. Re: how to bring in a swc ?
          Peter deHaan Level 4



          Do you know which version of the FLVPlayback.swc you are using?

          I've done this in the past with older versions of the SDK and FLVPlayback, but I don't believe I've tried it recently.


          Also, what are you finding flaky with the current Spark VideoPlayer class(es)? Please don't forget to report any issues in the public bug base at http://bugs.adobe.com/flex/ so we can investigate and keep track of all known issues.



          • 2. Re: how to bring in a swc ?
            Level 2

            i am new to Flex but not Flash. So I am not certain what a swc is even for but I assumed for going from flash to flex. The one in question is the FLVPlaybackAS3.swc.


            when i drag VideoPlayer into design, it sits there autoplaying even in design mode. So basically I fire up FB4 and vod (video on demand) starts playing. it can make for quite distracting coding. Also, when used with live streams the lag is like 15 to 20 seconds behind the live frame ... as in when i run the app, the frame displayed is way behind or freezes a lot.


            So, as I am quite experienced in Flash, i wanted to see how you bring Flash components into Flex. I also read a posting from someone who said swc's are for code but not user interface components.


            I can Embed SWF's though.


            the flvplayback control from flash that was recently released works well for live streams so i figured i would focus on that. could you post an example .zip that just shows how it is hooked into a FB4 application ?



            • 3. Re: how to bring in a swc ?
              Peter deHaan Level 4

              Thanks. I'll take a look at this and forward this around to the team and get their feedback.




              PS: Please remember to file any bugs for issues you encounter in the Flex 4 SDK and Flash Builder 4 at http://bugs.adobe.com/flex/

              • 4. Re: how to bring in a swc ?
                Peter deHaan Level 4

                Sorry, our video experts are out for the rest of the week so you're stuck with me.


                1) Download the latest FLVPlayback control SWC from http://www.adobe.com/go/fms_tools/ (FLVPlayback

                2) Click the "Download the tools" link.

                3) Agree to the licensing stuff and click Agree.

                4) Click the "Adobe FLVPlayback for Flash CS4 Professional and Flex" link to download the ZIP (you may need to sign in).

                4.5) Create a new Flex project in Flash Builder 4. Also, I'm using Nightly build from http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4.

                5) Extract the ZIP and copy the /FLVPlayback2.5/adobe/fms/samples/FLVPlayback_2.5.swc file into the new Builder project's /libs/ directory. (So it should be /libs/FLVPlayback_2.5.swc)

                6) Copy and paste the following code:

                <?xml version="1.0" encoding="utf-8"?>
                <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                            import mx.containers.Panel;
                            import mx.core.UIComponent;
                            import fl.video.*;
                            private function onCreationComplete():void {
                                var vid:FLVPlayback = new FLVPlayback();
                                vid.source = "http://helpexamples.com/flash/video/water.flv";
                                vid.skinBackgroundColor = 0x666666;
                                vid.scaleMode = VideoScaleMode.EXACT_FIT;
                                // vid.skin = "SkinUnderPlaySeekMute.swf";
                                // vid.skinAutoHide = false;
                                var ui:UIComponent = new UIComponent();
                                ui.width = vid.width
                                ui.height = vid.height;
                                var pan:Panel = new Panel();
                                pan.title = vid.source;
                                pan.horizontalCenter = 0;
                                pan.verticalCenter = 0;

                Hope that helps,



                Message was edited by: Peter deHaan (Adobe) -- Clarified the /libs/ SWC location. You only need to copy the one SWC, not recreate any sort of folder structure.

                • 5. Re: how to bring in a swc ?
                  Level 2


                  thanks a million.

                  • 6. Re: how to bring in a swc ?
                    rfrishbe Level 3

                    Hey Drew,


                    I think you will find that the VideoPlayer/VideoElement components will work as you want.  There are currently some issues with it in Design View, but those should be getting ironed out.  Outside of design view and in the main SWF, it should work as expected.  If you find any issues with this, please let us know/file bugs.