A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] problem removing movie clip

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    resolved [RESOLVED] problem removing movie clip

    Attachment 74327Hi,

    I'm attaching the fla to simplify my explaining...

    I need to remove or perhaps sawpDepths of the clip loaded into the thumbnails, but I have tried a couple of ways like:



    Code:
    this.targetBox.removeMovieClip("image - "+n);
    this.targetBox["image - "+n].removeMovieClip();
    but I get no results. Any ideas will be appreciated.

    thanks
    Last edited by capdetrons; 07-04-2013 at 12:52 PM. Reason: attach fla

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Not sure when you want to remove them or how, but here, if you do it by button/clip
    PHP Code:
    but.onPress = function()
    {
        for (
    01s++)
        {
            
    _root["box" s].targetBox["image - " s].removeMovieClip();
        }
    }; 

  3. #3
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Not really sure whats going on or what you want, but a few things were missing from the code, a few "this."

    OK, for the loading Code frame use
    PHP Code:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;

    function 
    loading_function(a:Number):Void
    {
        if (
    this["box" a] != box1)
        {
            
    this["box" a].onPress = function():Void 
            
    {
                
    temp a;
                
    = eval(prevTop ".id");
                
    box1.targetBox.attachMovie("image - " a,"image - " a,box1.targetBox.getNextHighestDepth());
                
    this.targetBox.attachMovie("image - " n,"image - " n,this.getNextHighestDepth());
                
    box1.id a;
                
    n;
                var 
    xThumbTween:Tween = new Tween(eval("box" temp), "_xScale"Regular.easeInOut, eval("box" temp)._xscale301.5true);
                var 
    yThumbTween:Tween = new Tween(eval("box" temp), "_yScale"Regular.easeInOut, eval("box" temp)._yscale301.5true);

                var 
    xScaleTween:Tween = new Tween(box1"_xScale"Regular.easeInOut30box1.targetBox._xscale2true);
                var 
    yScaleTween:Tween = new Tween(box1"_yScale"Regular.easeInOut30box1.targetBox._yscale2true);

                if (
    temp == eval("box" temp ".id"))
                {
                    eval(
    prevTop).boxMask._width = eval(prevTop).targetBox["image - " temp]._width;
                    eval(
    prevTop).boxMask._height = eval(prevTop).targetBox["image - " temp]._height;
                    eval(
    prevTop).boxOutline._width = eval(prevTop).targetBox["image - " temp]._width;
                    eval(
    prevTop).boxOutline._height = eval(prevTop).targetBox["image - " temp]._height;
                }
            };
        }

        
    this["box" a].targetBox.attachMovie("image - " a,"image - " a,targetBox.getNextHighestDepth());

        
    box1.boxMask._width box1.targetBox["image - " a]._width;
        
    box1.boxMask._height box1.targetBox["image - " a]._height;
        
    box1.boxOutline._width box1.targetBox["image - " a]._width;
        
    box1.boxOutline._height box1.targetBox["image - " a]._height;

    for the actionscript frame, use
    PHP Code:
    var b:Number 3;
    var 
    shift_x:Number 30;
    var 
    thumbY:Number 15;
    var 
    thumbscale:Number 30;
    var 
    thumb_spacing:Number thumbscale 3.5;
    var 
    c:Number 2;

    while (
    <= b)
    {
        
    attachMovie("picHolder","box" c,this.getNextHighestDepth(),{_xscale:thumbscale_yscale:thumbscale_x:shift_x_y:thumbYid:c});
        
    shift_x shift_x thumb_spacing;
        
    1;
    }

    box1.id 1;
    box1._y thumbscale 4;
    box1._x 30;
    box1.swapDepths(this.getNextHighestDepth());

    box1.onPress = function():Void 
    {
        
    startDrag(this);
    };

    box1.onRelease = function():Void 
    {
        
    stopDrag();
    };

    var 
    prevTop:String "box1"
    does that make anything better ???

  4. #4
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Hi,

    thanks, but no, I just want to remove the image that is going to be replaced in the thumbnail, I don't think swapping depths will be any good. I would have to fully understand the eval method before trying to apply it to the thumbs and buiding loops still gives me a hard time.

    your code keeps the tween effects from working.

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