2 Replies Latest reply on May 26, 2008 9:36 AM by clbeech

    different movie each time page loads

      I'm not sure if this is an action script or not...but I have 6 movies within flash that I would like to run each time there is a page loaded. For example, if person A comes to the site, they would see Movie1, then when person B comes and loads the page another movie would show, like movie 2. So each time the site loads the page, a new movie would load, and it would just rotate through all six movies. Is this possible to do?
      Thanks for any help!!
        • 1. Re: different movie each time page loads
          Ned Murphy Adobe Community Professional & MVP
          I don't think there's an actionscript solution, though I could be wrong. The compiled Flash file isn't likely to be able to alter its code to switch the order of things.

          What you could possibly do is have a datafile that is read in that lists the movies and is then rewritten with the first item in the list shuffled to the end of the list. There is probably a potential problem in the event more than one person is accessing the file at the same time.

          Maybe someone with a better idea will ring in.
          • 2. Re: different movie each time page loads
            clbeech Level 3
            a) if the 'movies' are all within the same file and are individual MCs you could simply use an array and a random selection to 'play' an of the clips.

            b) if they are seperate SWF files then what you need to do is create a 'master' loading SWF file - and use it to 'load' any of the others into it using the MovieClipLoader class and again a random selection

            c) you 'could' do this with a JavaScript method that selects a file from an array in a similar manner as above and loads that SWF file.

            d) you 'could' create a PHP file directory reader that 'looks' into a directory where all your SWF files are stored, selects one at random and returns the correct file to the embed method.

            e) you 'could' use an XML data file (like Ned suggests) that also selects from a list of SWF files to load using the MCL class.

            the last two methods have more 'dynamic' implications, where you could 'adjust' the content at anytime by simply adding files to the directory (d) or to the XML file list of paths (e).

            so which fits your criteria and skills best?