12 Replies Latest reply on Dec 20, 2009 8:14 AM by Ned Murphy

    How to use embed object in flash?

    sazap

      I am creating a flash website and wanted to use a music player, how can i use the embed code in flash?

       

      Thanks

        • 1. Re: How to use embed object in flash?
          Ned Murphy Adobe Community Professional & MVP

          In what way do you mean "embed"?  As far as I know there is no embed command in Flash.  If you mean you have a music player as a separate file and you want to incorporate it into your Flash site, then you will want to either load it dynamically using actionscript or copy its timeline into a movieclip so that you have it in your library as a symbol that you can place on the stage.

          • 2. Re: How to use embed object in flash?
            sazap Level 1

            this is the embed code

             

            <object width="250" height="252"> <param name="movie" value="http://listen.grooveshark.com/widget.swf"></param> <param name="wmode" value="window"></param> <param name="allowScriptAccess" value="always"></param> <param name="flashvars" value="hostname=cowbell.grooveshark.com&widgetID=18558782&style=metal&bbg=000000&bfg=0b8a cf&bt=ffffff&bth=000000&pbg=ffffff&pbgh=0b8acf&pfg=000000&pfgh=ffffff&si=ffffff&lbg=ffffff &lbgh=0b8acf&lfg=000000&lfgh=ffffff&sb=ffffff&sbh=0b8acf&p=0"></param> <embed src="http://listen.grooveshark.com/widget.swf" type="application/x-shockwave-flash" width="250" height="252" flashvars="hostname=cowbell.grooveshark.com&widgetID=18558782&style=metal&bbg=000000&bfg= 0b8acf&bt=ffffff&bth=000000&pbg=ffffff&pbgh=0b8acf&pfg=000000&pfgh=ffffff&si=ffffff&lbg=ff ffff&lbgh=0b8acf&lfg=000000&lfgh=ffffff&sb=ffffff&sbh=0b8acf&p=0" allowScriptAccess="always" wmode="window"></embed></object>

            • 3. Re: How to use embed object in flash?
              Ned Murphy Adobe Community Professional & MVP

              That code is not used in Flash, it is used in the html page that you embed the Flash file into.  You do not use the code you showed for placing a Flash file within a Flash file.

               

              If you created the music player yourself in Flash or have the Flash fla file, you can have Flash generate the embedding code by publishing an html page via the Publish Settings, and then copy and paste that code into whatever html page you are using for the site.

               

              If you don't have the fla file for the music player, then your best bet at getting some form of usable code for inserting it into a web page will be to use Dreamweaver to insert the Flash embedding code into the html page... though I usually recommend against using Dreamweaver for that.  YOur other option is to take the code you showed and adjust every parameter in it to be in agreement with the properties of your music player (file name, width, height, etc)

              • 4. Re: How to use embed object in flash?
                sazap Level 1

                will i need to take the flashvars and use them as variables?

                • 5. Re: How to use embed object in flash?
                  Ned Murphy Adobe Community Professional & MVP

                  Does that embedding code have any relationship to the file you plan to use....  where did you get that code?  Do you have the fla file for the music player?  If not, there isn't much you can do regarding the variables except to assign them values if they have anything to do with that file.

                  • 6. Re: How to use embed object in flash?
                    sazap Level 1

                    its a widget from grooveshark.com


                    • 7. Re: How to use embed object in flash?
                      Ned Murphy Adobe Community Professional & MVP

                      And the code?

                       

                      I'll tell you what... place that code in an html web page and see what it does.  If it doesn't do what you expect, then contact the folks at grooveshark and ask them how you are supposed to use their widget.  THey will be in a better position than anybody else to help you out.

                      • 8. Re: How to use embed object in flash?
                        sazap Level 1

                        it works in html but is there a way i can use that widget in flash

                        • 9. Re: How to use embed object in flash?
                          carl schooff Level 3

                          create a new html file, paste that code in the <body> and you are good to go.

                          That codes allow you to pull a swf from the grooveshark site into an html page. the flash vars make it possible to see songs from your account.

                           

                          this code is not going to let you create your own swf that pulls in the grooveshark swf. It may be possible to load that swf into another swf but getting the proper variables sent may or may not be possible.

                          • 10. Re: How to use embed object in flash?
                            Ned Murphy Adobe Community Professional & MVP

                            I identified your options for that in my first response, but since you apparently don't have even the swf file, it is questionable if you will be able to use it in a Flash file due to security/sandbox restrictions of Flash.  If you had the swf on your own server you could load it into your Flash file dynamically, but then I cannot answer for what you'll need to do with regard to the flashvars that are apparently involved.

                             

                            If you plan to use someone else's widget in your design, it is best to contact them about it to see if they can can assist you or even allow that.

                            • 11. Re: How to use embed object in flash?
                              sazap Level 1

                              ok thanks for your help


                              • 12. Re: How to use embed object in flash?
                                Ned Murphy Adobe Community Professional & MVP

                                You're welcome