-
[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
-
.
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 (s = 0; s < b + 1; s++)
{
_root["box" + s].targetBox["image - " + s].removeMovieClip();
}
};
-
.
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;
n = 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;
a = n;
var xThumbTween:Tween = new Tween(eval("box" + temp), "_xScale", Regular.easeInOut, eval("box" + temp)._xscale, 30, 1.5, true);
var yThumbTween:Tween = new Tween(eval("box" + temp), "_yScale", Regular.easeInOut, eval("box" + temp)._yscale, 30, 1.5, true);
var xScaleTween:Tween = new Tween(box1, "_xScale", Regular.easeInOut, 30, box1.targetBox._xscale, 2, true);
var yScaleTween:Tween = new Tween(box1, "_yScale", Regular.easeInOut, 30, box1.targetBox._yscale, 2, true);
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 (c <= b)
{
attachMovie("picHolder","box" + c,this.getNextHighestDepth(),{_xscale:thumbscale, _yscale:thumbscale, _x:shift_x, _y:thumbY, id:c});
shift_x = shift_x + thumb_spacing;
c = c + 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 ???
-
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|