A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [F8] [AS2] My movie will only duplicate once

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    6

    [F8] [AS2] My movie will only duplicate once

    its an animation where a cup is supposed to pour out a bunch of beads and they fall into the shape of the company's logo ive gotten it to drop one bead but it wont duplicat more than once heres the AS

    var mcBead:MovieClip;
    var beadCount:Number = 1;
    var initBead:Object = new Object;

    initBead.onEnterFrame = function(){
    this._y += 25;
    }
    this.onLoad = function() {
    for(var i = 0; i<100; i++){
    makeABead();
    }
    };


    function makeABead() {
    beadName = "mcBead"+String(beadCount);
    beadDepth = this.getNextHighestDepth();
    mcBead.duplicateMovieClip(beadName, beadDepth, initBead);
    this[beadName]._x = mcCup._x;
    this[beadName]._y = mcCup._y;
    beadCount++;
    }

    i have attached a copy of the fla file for you to look at, thanks
    Attached Files Attached Files

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Can't open your file, I've only got Flash MX 2004. Maybe you can adapt this to what you are trying to do...
    Code:
    var mcBead:MovieClip;
    var beadCount:Number = 1;
    var initBead:Object = new Object();
    initBead.onEnterFrame = function() {
    	this._y += 25;
    };
    function doBeads() {
    	if (beadCount < 100) {
    		makeABead();
    	} else {
    		clearInterval(intID);
    	}
    }
    function makeABead() {
    	beadName = "mcBead" + String(beadCount);
    	beadDepth = this.getNextHighestDepth();
    	mcBead.duplicateMovieClip(beadName, beadDepth, initBead);
    	this[beadName]._x = mcCup._x;
    	this[beadName]._y = mcCup._y;
    	beadCount++;
    }
    doBeads();
    intID = setInterval(doBeads, 500);

  3. #3
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    that worked great but i need them to duplicate much faster and then stop duplicating at the end THANKS
    Last edited by soulfrigginfly; 12-04-2008 at 10:53 PM.

  4. #4
    Junior Member
    Join Date
    Nov 2008
    Posts
    6
    Ive still got a few more kinks to work out but nothing major thank a billion to dawsonk for the help

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