Im trying to duplicate a movieclip, that is trailing to my mouse (only on the _x axis). Now I want to duplicate that movieclip several times and making the duplicates follow the first movieclip, but with a _x difference between them (lineair steps).
Now I can get the first movieclip to follow the mouse on the _x axis, and I can get to duplicate it several times, but I get stuck when trying to add the actions to the ones I’ve duplicated…
well this code is pretty messy, because I was just playing with it a little bit.
Im eventually not going to use it as a mouse trailer but more like a component for displaying pictures, this is why I want to use duplicated MC’s (and external jpeg’s). Now I don’t know how to load those correctly into a duplicated movieclip but I reckon it should be similar to the code for making the duplicated mc’s work.
Ok, dat laatste gedeelte maakt het allemaal een beetje heel erg verwarrend… sorry…
Ok, dat laatste gedeelte maakt het allemaal een beetje heel erg verwarrend… sorry…
Inderdaad
I’m not sure what exactly it is you are trying to achieve. To load to a duplicated movieclip or to create a mouse trailer using duplicated movieclips ?
yeah this was the kind of code I was looking for, much better than that old FLash 4 duplicateMC stuff I reckon!
So I’ve played around with it a little, but when I tried to add some movement to the clips I ran into a problem because the function() command is only running once;
this is my code now (thanks to Voetsjoeba !):
well this code only runs for as long as i is being iterated. and only when that happens.
So when you run a trace on m.distX ( trace(m.distX) ) you will get only 4 values, and the movieclips change accordingly, but that is not very usefull, since they move only once.
So what you want them to do is keep following the mouse, after the for([…]) loop has ended, but that doesn’t happen with this code, I don’t really understand why though.
Hope that explains it a little bit…
PS: is Ghent niet zonder G of zie ik iets over het hoofd? (nou ja ik ben natuurlijk een nederlander en geen belg )
yup that code works great, cept there is one problem; everything on the stage moves along in the mouse trailer function, so not just the created movieclips…
this looks really strange offcourse, and I didnt figure out yet how to stop it from happening.
only one more question (I hope): how can I trigger the movement part with a button? As in; I only want the last part of the code to be executed after I’ve pressed a button elsewhere on the stage?
With the last code I got it to work but I can’t get it working in the new version anymore :puzzle:
anyway, i’d like to thank you very much for you help already voetsjoeba, and Im sorry that Im a little confusing in what I want to do because Im learning how to do this first, so I can make a useful implementation of it later. Like: Im not going to use this exact code but if I can get this to work I know how to get something else to work, so I could make that myself. So thanks a lot as well for teaching me a whole lotta new stuff =)
Just create a movieclip with your mask in it, set the registration point to the left so you can easily control it’s position relative to the images, then use the setMask method