5 Replies Latest reply on Jun 28, 2008 12:27 AM by Noelbaland

    Loading a SWF

      hey i have a flash made website with lots of content, pictures, and pages. one of the sections is a "team" section with different bios on team members. i had download a free XML image gallery that i want to be displayed when a certain button is clicked. the XML gallery comes with a SWF.

      what code and where do i put it to make the gallery display?


      - the ideal thing would be having the whole XML gallery SWF "BE" a movie clip in my flash document for easy editing (when i tried to import into the library flash says the author has protected it)

      - this didnt work

      loadMovie ("mymovie.swf", "myClip");
      myClip._y = 350;
      myClip._x = 250;

        • 1. Re: Loading a SWF
          Noelbaland Level 1
          Hi there,

          Is your myClip mc created on the stage and set with the same width and height as the mymovie.swf your loading in? Or have you used actionscript to dynamically create the myClip mc (via createEmptyMovieClip)?? And is the mymovie.swf and XML file inside the same folder as your main movie?

          • 2. Re: Loading a SWF
            Waffle_Cone_Zone_.com Level 1
            well im sure how to tell how big the gallery.swf is but the "gallery" movie clip on the stage has a square on the stage that is more than big enough.

            no the mc is in the library and dragged onto the stage on a layer on a frame.

            yes all of the files that came with the gallery are in the same folder as the html that i publish too.

            maybe the gallery.swf is inserted somewhere off of the stage

            loadMovie ("mymovie.swf", "myClip");
            myClip._y = 350;
            myClip._x = 250;

            what should i put for the x and y?

            • 3. Re: Loading a SWF
              Noelbaland Level 1
              Hello again,

              Try this for now. Delete the myClip mc off the stage. If you don't have one, create an Actions layer on the main timeline. Put the following script on the frame above your "team" section.

              this.createEmptyMovieClip("myClip", 1);
              myClip._x = 350;
              myClip._y = 250;

              Test your movie and in the window go to Debug>List Variables. Have a quick look thru the code and see if you can see an XML structure in there. Just testing to see if the supplied XML file for the gallery is loading properly.

              Thanks again
              • 4. Re: Loading a SWF
                Waffle_Cone_Zone_.com Level 1
                hey thats better!

                using that code made the xml swf load but its stuck on the laoding screen!

                it amde the following output error orrcur

                Error opening URL 'file:///Big%20Nig/Websites/Waffle%20Cone%20NEW/undefined'

                that is the folder that i keep all the stuff for t he site, all of the files that came with the gallery are placed in this folder.

                the debug is kinda lengthy but it had this

                Variable _level0.updatezone.allwindows.rider_kael.myClip.instance51.cacheAsBitmap = [getter/setter] false
                Variable _level0.updatezone.allwindows.rider_kael.myClip.instance51.blendMode = [getter/setter] "normal"
                Variable _level0.updatezone.allwindows.rider_kael.myClip.instance51.tabIndex = [getter/setter] undefined
                Movie Clip: Target="_level0.updatezone.allwindows.rider_kael.myClip.instance51.instance52"
                Edit Text: Target="_level0.updatezone.allwindows.rider_kael.myClip.title"
                autoSize = "none",
                thickness = 0, length = 20, wordWrap = false, border = false,
                textColor = 16777215, scroll = 1, tabIndex = undefined, maxChars = null,
                sharpness = 0,
                antiAliasType = "advanced",
                textHeight = 14, maxscroll = 1, password = false,
                htmlText = "Loading Gallery XML!",
                backgroundColor = 16777215, condenseWhite = false, embedFonts = false, multiline = false,
                type = "dynamic",
                gridFitType = "subpixel",
                mouseWheelEnabled = true, borderColor = 0, restrict = null, selectable = false,
                hscroll = 0, variable = null,
                text = "Loading Gallery XML!",
                background = false, styleSheet = undefined, html = false, bottomScroll = 1,
                filters = [object #32, class 'Array'] [], textWidth = 121, maxhscroll = 0
                Button: Target="_level0.updatezone.allwindows.rider_kael.myClip.downloadButton"
                Variable _level0.updatezone.allwindows.rider_kael.myClip.downloadButton.scale9Grid = [getter/setter] undefined
                Variable _level0.updatezone.allwindows.rider_kael.myClip.downloadButton.filters = [getter/setter

                hope that helps

                • 5. Re: Loading a SWF
                  Noelbaland Level 1
                  Hi again,

                  OK - so the debug and error message tells us that the XML file is not loading. That's why it's stuck on the loading screen.
                  Create a new folder inside the same directory and call it "test". Now copy your main movie swf, the published HTML file that goes with it, the gallery swf, the HTML file that goes with it, the gallery XML file and the images folder that you use. We want your structure to look like this

                  - main.swf
                  - main.html
                  - gallery.swf
                  - gallery.html
                  - gallery.xml
                  - images

                  Open the main.html file in your browser. See if that's made any difference?

                  Also if you open the gallery.html - does it work?