2 Replies Latest reply on Mar 26, 2008 4:01 AM by Sunnyspring

    Action Script and buttons in a Movie Clip

      We have made a homepage with a slideshow rolling down the screen. The slideshow consist of pictures which are converted to buttons. What we want to do is to get a bigger picture of the tiny pictures in the slideshow load onto the screen when one of the buttons is pressed.

      On the top layer of the timeline, I have made a layer called actions. It consists of the following code for each picture:

      slideshow_MC.kjole1_btn.onRelease = function() {
      loadMovie("kjole1-stor.jpg", ramme);

      I have also given name to the different necessary instances.
      1. The movie clip has the instance name “slideshow MC”
      2. The button has names like the one above “kjole1_btn”, counting up to twelve.
      3. The rectangle I have put on the screen to give the position for the picture loaded, has the instance name “ramme” and is converted to a movie clip.

      Just to test, I made a simple file with the script above, and it worked just fine. But when I do the same thing in our project, I get this error message:

      Error opening URL “file:///|:kjole2-stor.jpg

      Can anyone please tell me what this error message means, and why it occurs?.
      The pictures are fine, and can be opened in the simpler file. When I check for syntax errors, there are none.

      Thanks in advance!
        • 1. Re: Action Script and buttons in a Movie Clip
          Venian Level 2

          When that error message appears it clearly means the path to the file is not right. You could have placed the pictures in another directory then the one you think you placed or the name of the directory in which the pictures reside is miswritten, or you have the name of the picture or pictures miswritten.

          Or, for example, if you have an image like this "House.JPG", "hOuse.jpg", "house.Jpg" on your hard-disk and access it locally from action script by refering to it as "house.jpg", on your computer it works fine. But if you upload it all to a web server it doesn't work anymore.
          This is because windows is not case-sensitive while a web server is case-sensitive.

          Be extremely sure that you write the names corectly in and out of the Action Script.

          Good luck.
          • 2. Re: Action Script and buttons in a Movie Clip
            Sunnyspring Level 1
            The files are in the same location. I checked the file names. There was an error in one of them, a space that shouldn't have been there, I got rid of the space, and now the error message is gone, but no picture is loaded to the screen. I click the button, and nothing happens. The code is the same as above. Any suggestions?

            Is the extension name of a JPEG file always jpg?