13 Replies Latest reply on Nov 8, 2009 5:26 PM by kglad

    Integrate Flash banner in Flash website?

    codeoverride

      I'm building a portfolio website for my design work. The whole website is Flash based.

      I have a Flash banner that I would like to add to the website but I can't seem to place it on stage.

       

      Is there a way to stream the banner? If I do that, how do I place it's location on stage?

       

      Thanks!

        • 1. Re: Integrate Flash banner in Flash website?
          kglad Adobe Community Professional & MVP

          you can use flash embed code in your html file just like you would add an image reference.  using divs allows excellent control but, may not be necessary for your needs.

          • 2. Re: Integrate Flash banner in Flash website?
            codeoverride Level 1

            My entire website is in Flash, not HTML

            • 3. Re: Integrate Flash banner in Flash website?
              kglad Adobe Community Professional & MVP

              you use html to embed your swf(s).

              • 4. Re: Integrate Flash banner in Flash website?
                codeoverride Level 1

                Thanks but I don't know HTML yet.. is there a way to do it with actionscript?

                • 5. Re: Integrate Flash banner in Flash website?
                  Ned Murphy Adobe Community Professional & MVP

                  No, actionscript cannot embed a Flash movie in a web page.   Flash will generate the html page/code, and you can copy/paste it into another html file if you are inciorporating multiple Flash elements.  In your Publish Settings you need to select an html file output along with the swf for Flash to generate an html page that contains the swf file.

                  • 6. Re: Integrate Flash banner in Flash website?
                    kglad Adobe Community Professional & MVP

                    if you don't know html and don't make the effort to inspect the html file that embeds your swf (or, an alternative embedding html like swfobject), you cannot display 2 swfs on the same browser page unless you have someone else do this for you.

                     

                    ie, you can't solve your problem unless you open your mind and learn something (or, hire someone to do this for you).

                    • 7. Re: Integrate Flash banner in Flash website?
                      codeoverride Level 1

                      I just purchased an HTML book and I am making an effort. I was just trying to get some direction.

                      • 8. Re: Integrate Flash banner in Flash website?
                        kglad Adobe Community Professional & MVP

                        you don't really need to read a book.  but, good going.  you got direction and you're following it.

                         

                        open the flash embedding html file in a plain text viewer and check the file.  that may intimidate you.  you might do better to check swfobject and the way it embeds swf files.  all the intimidating code is in a javascript file so the swfobject html is easier to understand.

                         

                        but, html itself is not intimidating.  html is not a coding language.  it's much simpler than coding languages like actionscript because it's just a formatting language.

                         

                        and you don't need to learn much html to do what you want.  you just need to learn a little.

                         

                        between inspecting the embedding html file and using an online search engine (or, your book), you can probably solve your problem pretty quickly.

                        • 9. Re: Integrate Flash banner in Flash website?
                          codeoverride Level 1

                          Thanks for the help. The reason that I purchased an HTML book is that Flash seems to be on the way out and I'd like to learn how to build a website without using relying solely Flash.

                          • 10. Re: Integrate Flash banner in Flash website?
                            zeroskillz Level 3

                            Assuming that you are making the Flash website, just use a loader to load the .swf file and add it to the stage, like you would an image:

                             

                            pseudo code (meaning that im just typing from memory, so it should work but might have an error)

                             

                             

                             

                            var myLoader = new Loader();

                            var myBannerUrl = ("bannerFolder/banner.swf"); //full url OR path relative to the file loading it.

                             

                            myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addMyBannerToStage);

                            //to be thorough, an error listener and posibly a progress listener would be useful

                            myLoader.load(new URLRequest(myBannerUrl));

                             

                            function addMyBannerToStage(event:Event):void{

                                 myLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, addMyBannerToStage);

                                 var myBanner = myLoader.content as MovieClip; //if you want to access its functions/vars etc like any movieclip

                                 myBanner.x = 0; // x position

                                 myBanner.y = 0; // y position

                                addChild(myBanner);

                            }

                             

                            HTH

                            -Ted

                            • 11. Re: Integrate Flash banner in Flash website?
                              zeroskillz Level 3

                              oh and an alternate method--use an embed tag (cs4):

                               

                               

                               

                              [Embed(source="filesystemPathToYourBanner.swf")]

                              var Banner:Class;

                               

                               

                              var myBanner = new Banner();

                              myBanner.x = yadiyada, add your position stuff here

                              addChild(myBanner);

                               

                              HTH

                              -Ted

                              • 12. Re: Integrate Flash banner in Flash website?
                                codeoverride Level 1

                                I found this simple way to do it:

                                 

                                make a little rectangle box and place it in the upper left corner and make it a movie clip. Give the movie clip a property name of PlaceHolder or something simalair. THen type the fallowing code.


                                loadMovie("name.swf", PlaceHolder);

                                 

                                This worked but the .swf spills out of the movie clip. I don't have the original as I did not create it. Do I need to make a mask or is there another way to make it so that it does not spill out of the movie clip?

                                 

                                The last thing is that it also is clickable but the link goes nowhere. Because I didn't create the .swf I can't change the link. Is there a way to make it not clickable?

                                 

                                Thanks guys

                                • 13. Re: Integrate Flash banner in Flash website?
                                  kglad Adobe Community Professional & MVP

                                  you can resize name.swf AFTER loading is complete by assigning the _width and _height of PlaceHolder that you want.

                                   

                                  you can disable that swf's mouse handlers by assigning (again, AFTER loading is complete):

                                   

                                  PlaceHolder.onRelease = null;

                                  PlaceHolder.useHandCursor = false;