2 Replies Latest reply on Jun 22, 2006 4:57 PM by _Chewtoy_

    s it possible to use an empty movie clip as a button?

    erye Level 1
      Is it possible to use an empty movie clip as a button? Right now I load in an image from the xml file. I'd like to use this as a thumbnail that when clicked loads a swf movie on the stage.
      The loaded movie needs to be able to take the image path I send add an extension (lrg.jpg). So the loaded movie knows to display the larger version of the image.

      Does anyone have an example or can someone suggest a better way to achieve this?

      Thanks,
        • 1. Re: s it possible to use an empty movie clip as a button?
          caskater Level 1
          Any movieclip can be used as a button, but will only work if you have something actually visible to click on (an empty movie clip is just empty space).

          So what you want to do is load the image thumbnail into a movieclip, and then you'd put the following code onto the movieclip

          myClip.onRelease = function() {
          // open larger image here
          }
          • 2. Re: s it possible to use an empty movie clip as a button?
            _Chewtoy_ Level 1
            In your loop reading the xml values into the movieClips, assign the emptymovieclip an id ( I assume you know how :-) then attach a value to the movie clip, something like
            movieID.url = "biggerImageLink";

            then turn your (now filled) emptyMovieClip into a btn by using
            id.OnRelease = function () {
            //an example with getURL
            getURL(this.url);
            }
            then it's time to loop again for the next value from the XML.

            Hope this makes sense. I'm a bit tired and going to bed but I thought I'd try to help. Apologies for typos and bad memory of 'script.