3 Replies Latest reply on Jun 14, 2007 10:21 PM by kglad

    Replacing Movies

    SymTsb Level 2
      I have an issue with loading movies....actually jpgs....

      I have an image reel that loads jpgs into an mc at the lowest level of the DisplayObject container holding the reel. When the Image reel is instantiated, it loads the image into the background as it should. In Flash 8 this was a simple task of just loading your movie into that level and it would replace the swf or jpg at that level. In CS3, this isn't the case. kglad or anyone else....any idea on how to achieve this???
        • 1. Re: Replacing Movies
          kglad Adobe Community Professional & MVP
          use the loader class to load your jpg and use the addChildAt() method of the displayobjectcontainer to add the loader/jpg to depth 0. if you want to replace whatever was previously at depth 0, use the removeChildAt() method.
          • 2. Re: Replacing Movies
            SymTsb Level 2
            I've got it the jpg loading functionality working the first time. It's replacing it that is a problem.

            I was hoping there was some way to conditionally test if an image was at a level so that on first load it does one set of instructions and on the subsequent loads, it will remove the child from the display list and replace the image with the new one.

            For now, I have two functions. When the class is instantiated, it does the first function and on subsequent loads, the second function is used. If you can come up with a better way kglad, by all means, let me know.
            • 3. Re: Replacing Movies
              kglad Adobe Community Professional & MVP
              if there are no other children of the displayobjectcontainer you can use its numChildren property to determine whether this is the first child added or a subsequent one.