3 Replies Latest reply on May 7, 2007 4:01 AM by Sketchsta

    Load movieclips question...

    seamushamus
      Hi,
      I have a question. I want to use this flash file that I found, but it needs to be changed a bit if that is possible. When you play the file, several words that are in the action script are loaded and placed randomly on the screen.

      This is the part of the code where the words are made (I guess?)

      quote:

      this.somewords = "these are the words that are displayed";
      // convert the string of words into an array of words
      this.wordList = new Array();
      this.wordList = this.somewords.split(" ");
      // create one instance for each word in the list
      for (n=0; n<this.wordList.length; n++) {
      // pick a word from the list
      var word = Object.environment.wordList[n];
      var x = random(600)-300;
      var y = random(337)-169;
      var z = random(Object.environment.fl*2)-Object.environment.fl;
      // create an instance of the SpaceWord object
      nombre = "word"+String(depth++);
      initialization = {txtword:word, x:x, y:y, z:z};
      space.attachMovie("spaceWord", nombre, depth, initialization);
      }




      So if i play this you will see the words “these, are, the, words, that etc.” floating in the screen.

      So I thought it might be possible that I could change it so it doesn’t show the words but it shows a couple of movieclips from the library.

      But because I don’t know actionscript that good, I was wondering if anybody could help me with this.

      Thanks in advance,
        • 1. Re: Load movieclips question...
          davidupenn
          Hello - it sounds as if you need to use the loadMovie action. With loadMovie, you specify the movie name and the target where you want it to appear, like this:

          loadMovie("sample.swf", _root.movieholder)

          You could use a button to trigger the action by coding the loadMovie command into the "On (release)" action of the button. Sample.swf is simply the name of the Flash movie you wish to load. And movieholder is the instance name of the target movie clip which you can set up in a layer in your timeline.

          Hope this helps.
          • 2. Re: Load movieclips question...
            seamushamus Level 1
            well not really, because i would like to load movie clips from the library...
            • 3. Re: Load movieclips question...
              Sketchsta Level 1
              to load movies from the library use attachMovie()
              unlike loadMovie(), attachMovie() requires 3 paramiters.
              1 - the Linkage ID ( set this by right clicking the movie in the library, and choosing PROPERTIES )
              2 - an Instance name for the movie that is attached.
              3 - set a depth for the movieClip.

              then do what davidupenn said.