lonelyplanetwanderer
May 27th, 2002, 10:37 AM
hello boyz and girls...i am wondering where and how i can insert global variables in my code (below)....or is that too 'C' a concept!?!...see what i am trying to do here is this...onClipEvent calls within it attachMovie from my library with the appropriate linkages...a few setProperty here and there...what i want is a few characters initialised above the rest of the code...why?...coz as u will see, when k=0, a movie is picked up, put at level m=1...
...the second time round the loop begins, k=1 so a movie gets picked up again at random...now this is where i need ur help...the second (and subsequent 3 movies) need to be placed on top of the basemovie...i am trying swapdepths here...good choice?...anything else i can do?...yet to figure out reducing the opacity of subsequent movies...see i am looking for a motion trail kinda effect...so at one point of time 5 mc will be visible...total no. of mc=250 and at random they get picked up over and over again...
...would appreciate any advise...been trying loadmovie but then that doesn't work within onclipEvent!...moreover, onclipEvent doesn't allow any code outside its parantheses!...where can i initialise my k,j,m and alpha...
Note: this is a frame action and the movies get loaded in an empty mc...
...new to flash scripting...still romantic about C! =)
set (k,"0");
set (m,"1");
set (j,"0");
set (alpha,"100");
onClipEvent (load) {
//k=0;
//m=1;
if(k=0){
        i = Math.ceil(Math.random()*5);
        _root.textBox = "this is movie " +i;
        this.attachMovie("Symbol"+i, "fred"+i,m);
        setProperty ("fred"+i, _alpha, "alpha");
setProperty ("fred"+i, _x, "25");
setProperty ("fred"+i, _y, "10");
        k++;
}
else {
        i = Math.ceil(Math.random()*5);
        "fred"+j.swapdepths("fred"+i);
        _root.textBox = "this is movie " +i;
        this.attachMovie("Symbol"+i, "fred"+m);
        setProperty ("fred"+i, _alpha, "alpha-20");
setProperty ("fred"+i, _x, "25");
setProperty ("fred"+i, _y, "10");               
        j++;
        if (j=5) {j=0}
}
if (m<5) {m++}
else {m=1}
}
cheers!
...the second time round the loop begins, k=1 so a movie gets picked up again at random...now this is where i need ur help...the second (and subsequent 3 movies) need to be placed on top of the basemovie...i am trying swapdepths here...good choice?...anything else i can do?...yet to figure out reducing the opacity of subsequent movies...see i am looking for a motion trail kinda effect...so at one point of time 5 mc will be visible...total no. of mc=250 and at random they get picked up over and over again...
...would appreciate any advise...been trying loadmovie but then that doesn't work within onclipEvent!...moreover, onclipEvent doesn't allow any code outside its parantheses!...where can i initialise my k,j,m and alpha...
Note: this is a frame action and the movies get loaded in an empty mc...
...new to flash scripting...still romantic about C! =)
set (k,"0");
set (m,"1");
set (j,"0");
set (alpha,"100");
onClipEvent (load) {
//k=0;
//m=1;
if(k=0){
        i = Math.ceil(Math.random()*5);
        _root.textBox = "this is movie " +i;
        this.attachMovie("Symbol"+i, "fred"+i,m);
        setProperty ("fred"+i, _alpha, "alpha");
setProperty ("fred"+i, _x, "25");
setProperty ("fred"+i, _y, "10");
        k++;
}
else {
        i = Math.ceil(Math.random()*5);
        "fred"+j.swapdepths("fred"+i);
        _root.textBox = "this is movie " +i;
        this.attachMovie("Symbol"+i, "fred"+m);
        setProperty ("fred"+i, _alpha, "alpha-20");
setProperty ("fred"+i, _x, "25");
setProperty ("fred"+i, _y, "10");               
        j++;
        if (j=5) {j=0}
}
if (m<5) {m++}
else {m=1}
}
cheers!