Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

duplicate movieclip question in differnet directions

Status
Not open for further replies.

Chance1234

IS-IT--Management
Jul 25, 2001
7,871
US

The above effect is what i am tyring to improve on, basically i have a oval shape with the alpha set to 2 which moves left to right or right to left.

the above was set up by doing as a "animation" and im now trying to change it to code.

so,

i have created a oval called "sea" put it on the timeline, and for the frame i have added

for (i=0; i<200; i++) {
_root.sea.duplicateMovieClip("movie"+i, i);
}


then on the clip i have added
onClipEvent (load) {
this._x = Math.round(-10+Math.random()*800);
this._xscale = (50+Math.random()*900);
this._yscale = (50+Math.random()*100);
this._alpha = 2;
rxn = Math.round(2+Math.random()*4);
}
onClipEvent (enterFrame) {
x = (_root._xmouse+50)/rxn;
this._xscale = -x;
this._x -= x/10;
pos = this._x;
if (pos<-50) {
this._x += Math.round(800+Math.random()*100);
}
}

(taken from a previous post on grass)


All im getting though is one oval moving at a time, some pushes in the right direction would be appreciated.



Chance,

Filmmaker, gentlemen and explorer

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top