Skip to main content
Participant
May 4, 2007
Question

Load movieclips question...

  • May 4, 2007
  • 3 replies
  • 272 views
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;
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,
This topic has been closed for replies.

3 replies

Inspiring
May 7, 2007
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.
Participant
May 7, 2007
well not really, because i would like to load movie clips from the library...
May 4, 2007
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.