15 Replies Latest reply on Jun 22, 2006 9:00 AM by kglad

    loading gif into flash player 8 problem!

    claire_wall Level 1
      Hi all

      Can anyone help please?

      I am having a problem dynamically loading a gif file into my swf, using flash player 8 at run time.

      I am using flashMX to develop my site but I do understand that dynamically loading gifs & pngs has recently be introduced in the new flash player 8 so I test my swf in a browser window to see the correct result.

      First of all let me explain what im trying to do,

      I am using myMovieClip.loadMovie("http//:myURL.picture.gif"); because I want to load the picture into a target movieclip.

      This works well when I load jpg or swf files, but when I try and load a gif in the same way nothing happens?

      I then used loadMovieNum("http//:myURL.picture.gif", 2); to see if I got a different result.

      This loads the gif correctly into a new level in my flash movie which is good in a way because I know the flash player can display the gif.

      BUT I don't want the picture in a new level in my flash movie, I need it in a target movieclip ???

      Can anyone suggest why the loadMovie is not loading the gif.

      Thanks for any help

      Claire Wall
        • 1. Re: loading gif into flash player 8 problem!
          kglad Adobe Community Professional & MVP
          is myMovieClip a correct path/file name reference to a visible movieclip?
          • 2. Re: loading gif into flash player 8 problem!
            claire_wall Level 1
            Hi Kglad

            Thanks for replying, yes myMovieClip is referanced to _root and all the url path ways are correct. I have had it working very well when loading jpgs and swfs from the same folder, but for some reason it doesnt want to load gifs using _root.myMovieClip.loadMovie("blah blah");

            The bit I dont get is why it will load a gif using loadMovieNum(); ??? Which is a pain because I know the flash player has this capability but just doesnt work in the loadMovie() method!

            I need the gif inside a movieclip so I can manipulate it seperatly from the _root

            Any Ideas?

            Thanks

            Claire Wall
            • 3. Re: loading gif into flash player 8 problem!
              kglad Adobe Community Professional & MVP
              if you're certain you're publishing for flash 8 (file/publish settings/flash tab), post a link to your problem fla and specify the location of your loadMovie() statement.
              • 4. Re: loading gif into flash player 8 problem!
                claire_wall Level 1
                Hi Kglad

                I think this must be the problem, I am using flash MX as my authoring environment and when I look at my publish settings I can only specify up to flash 6 under the (file/publish settings/flash tab).

                Does this mean my swf wont be correctly formatted to import gifs when it is then run in flash 8 player in a browser?

                Thanks

                Claire x
                • 5. Re: loading gif into flash player 8 problem!
                  kanukukreja Level 1
                  flash still not support GiF images
                  as i got the same problem in my slide show when i tried to upload GIF images from XML.
                  you can upload GIF images in flash only with the help of flash remoting.
                  • 6. Re: loading gif into flash player 8 problem!
                    claire_wall Level 1
                    Hi kanukukreja

                    I would of agreed with you before I read some macromedia documentation about the new flash player 8 & flex 1.5. I have included the link below, mabey im reading it wrong but I think it says the new flash player 8 can load gif files. Have a look see what you think?

                    "... Because you gain many of the key benefits of Flash Player 8 in your Flex 1.5 applications, Macromedia has no plans to release a new version of Flex specifically for the Flash Player 8 version. Using Flex 1.5, you can leverage performance improvements, memory consumption improvements, and many of the new features in Flash Player 8, including file upload/download, the ActionScript/JavaScript API, improved video quality, GIF loading, and many more features.

                    While you may see opportunities to use many of the new features in Flash Player 8, the following is a quick rundown of the major new features of Flash Player 8 that are interesting to most Flex 1.5 developers. ...."

                    http://www.adobe.com/devnet/flex/articles/fp8_benefits.html

                    Thanks for the reply :-)
                    • 7. Re: loading gif into flash player 8 problem!
                      kanukukreja Level 1
                      please also tell me the solution if u got any.
                      may be there is some another way of doing this but normally it won't be possible and i'm damm sure about it.
                      atleast through XML it's not possible for sure.
                      • 8. Re: loading gif into flash player 8 problem!
                        kanukukreja Level 1
                        this.coloringBook_mc.loadGif("clown.gif");
                        "coloringBook_mc" (ur movieclip name)
                        • 9. Re: loading gif into flash player 8 problem!
                          kanukukreja Level 1
                          public function loadGif(file_str:String):Void {
                          //remove the lister from the instance of MovieClipLoader
                          this._loader_mcl.removeListener(this);
                          //delete the instance of MovieClipLoader
                          delete this._loader_mcl;
                          //create a new MovieClipLoader with the instance name '_loader_mcl'
                          this._loader_mcl = new MovieClipLoader();
                          //add 'this' as a listener to '_loader_mcl'
                          this._loader_mcl.addListener(this);
                          //load the image passed as a parameter to 'file_str' into the MovieClip '_imageHolder_mc.image_mc'
                          this._loader_mcl.loadClip(file_str, this._imageHolder_mc.image_mc);
                          }
                          • 10. Re: loading gif into flash player 8 problem!
                            claire_wall Level 1
                            Hi kanukukreja

                            Im still stuck with loading a gif into a movieclip using loadMovie(), sorry...

                            but the method I described above loadMovieNum() does load a gif into a new level in your flash movie, so if its any help you can try it. The problem is scoping to the gif once it is there, it will sit on a new level on your main timeline. Also make sure it loads onto a new level that does not have any other items in it or the gif will replace what ever is there.

                            so for example you could use;

                            loadMovieNum("clown.gif",10); // 10 will be the new level in your movie

                            Make sure your image is in the same folder as the swf or you will need to add a complete path way to the image ie. mainFolder/newFolder/clown.gif

                            Make sure you have the latest version of the flash player 8. Also You wont see the swf load the gif in your authoring enviroment unless you are using flash 8, so you will have to run the swf in a browser window.

                            This means I dont have an answer on how to load the gif into a target movieclip;
                            this._loader_mcl.loadClip(...

                            If you find one please let me know to.

                            Still confused :-(

                            • 11. Re: loading gif into flash player 8 problem!
                              kanukukreja Level 1
                              check out this new method introduced in flash 8 "MovieClipLoader"
                              • 12. Re: loading gif into flash player 8 problem!
                                claire_wall Level 1
                                sorry kanukukreja I only have flashMX, Im abit behind the times its my employers version of flash and he hasnt updated it for work yet :-(
                                • 13. Re: loading gif into flash player 8 problem!
                                  kglad Adobe Community Professional & MVP
                                  if you're not publishing for flash 8, you can't use loadMovie() to load your gif. and if you're using flash mx, you're not publishing for flash 8. it doesn't matter what's in your code, you're directing the flash player (version 8 if the user has it installed) to use flash 6 settings. that won't load a gif using loadMovie()

                                  use loadMovieNum and reference the _level (after loading is complete) to control the loaded gif. you should be able to work-around this inconvenience.
                                  • 14. Re: loading gif into flash player 8 problem!
                                    claire_wall Level 1
                                    Thanks Kglad

                                    I thought this might be the case, I will have a go at loadMovieNum but I think it will be to difficult to intergrate it into the rest of my movie. My employer will have to decide wheather this is worth it.

                                    Cheers guys for the feedback it has solverd the mystery at least ;_0

                                    Claire Wall
                                    • 15. Re: loading gif into flash player 8 problem!
                                      kglad Adobe Community Professional & MVP
                                      you're welcome. you could try a work-around if it's that hard to use a _level instead of a target movieclip:

                                      you could edit the html page published by flash mx to make it think you published for flash 8.