A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: stop the galaxy

  1. #1
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212

    stop the galaxy

    hi ,
    I am using an actionscript warpfield in an animation, but I don't know how to make it dissapear when I jump to a next scene!
    I thought something like Star.removeMovieClip(); but I cannot make it happen.

    The warpfield looks like this
    var maxY = 450;
    function star (){
    this.Dot._xscale = this.Dot._yscale = 10;
    this._rotation = Math.round(Math.random()*360);
    this.scal = .5;
    var r = Math.random()
    this.scalFact = 1+r/3;
    this.Dot._y = maxY-r*maxY;
    }
    star.prototype = new MovieClip;
    sp = star.prototype;
    sp.onEnterFrame = function(){
    this.scal*=this.scalFact;
    this.Dot._xscale = this.Dot._yscale+=this.scal/3;
    this.Dot._y+=this.scal;
    if(this.Dot._y>300){
    this.removeMovieClip();
    }
    }
    Object.registerClass("Star", star);

    function makeStar(){
    for(i=0; i<Math.random()*5+3; i++){
    ++starCount;
    attachMovie("Star", "Star"+starCount, starCount, {_x:275, _y:200});
    }
    }

    starGen = setInterval(makeStar,40);
    Please help me to make that galaxy dissapear, thanks!
    Jerryj.

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    what about using the same for loop you used to create them, to delete all instances?
    gparis

  3. #3
    Senior Member
    Join Date
    Nov 2004
    Location
    Amsterdam
    Posts
    212
    thanks!
    I couldn't manage to do that, but I found another solution, making an external movieclip with the starfield and then load and unload it in the main movie.
    Jerryj

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