A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Cs4 -As2 - Motion trail out of synch

  1. #1
    Junior Member
    Join Date
    Sep 2010
    Posts
    2

    Cs4 -As2 - Motion trail out of synch

    Hi All,
    I have created a bouncing logo (similar to a screensaver). The MC loops and I have added some motion trail using dupe mc's, however when the main MC loops back to the start, the motion trail seems to go out of synch and fall behind in its positioning. I have attached the FLA to show you what I mean and you can see the AS that I have used.

    Can someone help me get the motion trail to snch with the looping please?

    Thanks
    Attached Files Attached Files

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    onClipEvent (load) {
    	numCopies = 5;//Number of copies to make, adjust as you wish
    	this.swapDepths(1100);//Make sure the original MC is at the 'top of the pile'
    	if (_name == "pie") {//Only run this code from the original MC, not the dupes
    		for (i=1; i<numCopies+1; i++) {
    			duplicateMovieClip("_root.pie", "dmc"+i, i+1000);
    			_root["dmc"+i].nm = i;//Holds the # of the MC
    			_root["dmc"+i].af = 100/numCopies;//Used to calculate the amount to fade each MC
    			_root["dmc"+i].fr = 1-i;//Used to calculate which frame to go to
    			_root["dmc"+i].onEnterFrame = function() {
    				with (this) {
    					fr++;//Which frame?
    					if (fr>_totalframes) {
    						fr = 2;
    					}
    					//Loop it 
    					gotoAndStop(fr);
    					_alpha = 80-(af*nm);//Set alpha
    				}
    			};
    		}
    	}
    }

  3. #3
    Junior Member
    Join Date
    Sep 2010
    Posts
    2
    Hey thanks dawsonk, works a treat...sorry for being a newbie

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center