A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: how to clear: createEmptyMovieClip

  1. #1
    Senior Member
    Join Date
    Apr 2003
    Location
    Seattle
    Posts
    177

    how to clear: createEmptyMovieClip

    I am working with a slider that involves the following elements in AS2 (CS4):

    First: createEmptyMovieClip
    Second: attachMovie
    Third: onEnterFrame = scrolling

    The full script is below, and what I'm wondering about is that once the frame the script is on has been left and a separate button is pressed to go to a different frame, the emptyMovieClip flashes on the screen w.the attached movie. I can not understand what is causing this -is there a way to clear the createEmptyMovieClip ? The .FLA file is attached. Any help would be most appreciated!


    this.createEmptyMovieClip("container",1);
    var imagesNumber:Number = 12;
    var scrolling:Boolean = true;

    for (i=1; i<=imagesNumber; i++) {
    container.attachMovie("thumb"+i,"thumb"+i+"_mc",i) ;

    new Tween(myThumb_mc, "_alpha",Strong.easeOut, 0, 70, 40, false);

    myThumb_mc = container["thumb"+i+"_mc"];
    myThumb_mc._x = (i-1)*myThumb_mc._width;
    myThumb_mc._y = (Stage.height-myThumb_mc._height)/6.7
    myThumb_mc._alpha=50;
    myThumb_mc.largerImage = i;
    myThumb_mc.onRollOver = function(){
    this._alpha=100;
    }
    myThumb_mc.onRollOut = function(){
    this._alpha=70;
    }
    myThumb_mc.onRelease = function(){
    this._alpha=50;
    for (i=1; i<=imagesNumber; i++) {
    var myClip = container["thumb"+i+"_mc"];
    myClip.enabled = false;
    }
    scrolling = false;
    _root.attachMovie("image"+this.largerImage,"large_ mc",2);
    large_mc._x = (Stage.width - large_mc._width)/1.2;
    large_mc._y = (Stage.height - large_mc._height)/2.5;
    new Tween(large_mc,"_alpha",Strong.easeOut,0,100,0.5,t rue);
    new Tween(container,"_alpha",Strong.easeOut,100,50,0.5 ,true);
    large_mc.onRelease = function(){
    scrolling = true;
    var myFadeOut = new Tween (large_mc,"_alpha",Strong.easeOut, 100,0,0.5,true);
    myFadeOut.onMotionFinished=function(){
    for (i=1; i<=imagesNumber; i++) {
    var myClip = container["thumb"+i+"_mc"];
    myClip.enabled = true;
    }
    new Tween(container,"_alpha",Strong.easeOut,50,100,0.5 ,true);
    large_mc.removeMovieClip();
    }
    this.removeMovieClip();
    };
    };
    }
    container.onEnterFrame = function (){
    if (scrolling){
    this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*15;
    if (this._x>0) {
    this._x = 0;
    }
    if (-this._x>(this._width-Stage.width)) {
    this._x = -(this._width-Stage.width);
    }
    }
    };
    Attached Files Attached Files
    Last edited by llyfre; 06-07-2011 at 09:57 PM.

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