Question
Please see my code and helpme out pls
//Making Circle here
gridx=20;
gridy=20;
num=0;
for (var i=0;i < 10;i++)
{
for (var j=0;j < 10;j++)
{
dot.duplicateMovieClip("dot"+num,num);
mc=this["dot"+num];
mc._x=gridx*i;
mc._y=gridy*j;
num++;
}
}
dot._visible=0;
-------------------------------------------------------------------------------------------------------------------------------------------------------
// here i make plain circle, but problam is my all circle open in fornt side, i want to that all my circle in background
-------------------------------------------------------------------------------------------------------------------------------------------------------
//hide all selection MovieClip
for(i=1; i<=100; i++){
this.createEmptyMovieClip("test_mc"+i, this.getNextHighestDepth());
this["test"+i]._visible = false;
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
// here i make fill circle mc, all hide with this code, but problam is all circle come in background
-------------------------------------------------------------------------------------------------------------------------------------------------------
//selection area
_root.onMouseDown = function() {
sel = this.createEmptyMovieClip("sel", 1);
sel.startx = _xmouse; // we need to reference these later, so add them as properties of the selection clip
sel.starty = _ymouse;
this.onEnterFrame = function() {
with(sel){
clear();
lineStyle( 1, 000000, 100 );
moveTo(sel.startx, sel.starty);
lineTo(_xmouse, starty);
lineTo(_xmouse, _ymouse);
lineTo(sel.startx, _ymouse);
lineTo(sel.startx, sel.starty);
}
};
};
_root.onMouseUp = function() {
_root.select(sel.startx,sel.starty,sel._xmouse,sel._ymouse); // call the selection function
removeMovieClip(sel);
this.onEnterFrame = undefined;
};
_root.select = function(x1:Number,y1:Number,x2:Number,y2:Number){
// in case you dragged the selection box from right to left or bottom to top, we need
// to work out the top left and bottom right coordinates..
var sx = Math.min(x1,x2);
var ex = Math.max(x1,x2);
var sy = Math.min(y1,y2);
var ey = Math.max(y1,y2);
for(var item in this){ // loop through all items in the _root
if(typeof(this[item])=="movieclip"){ // if the current item is a movieclip..
this[item]._visible = isInside(this[item],sx,sy,ex,ey);
}
}
}
function isInside(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):Boolean{
// check whether the selection coordinates enclose the mc coordinates
return (x1<=mc._x && x2>=mc._x+mc._width && y1<=mc._y && y2>=mc._y+mc._height);
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
// here u can find selection option, selection option is wroking, but same problam, it work in background, & hide my all MC (that Plain Circle also) and highlight only which we select
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
// Some brif here:
i want to create plain circle in background, after that some one want to slecte that palin circle highlight that circle only with fill circle ( for better explaination see my fla file which is attach here
-------------------------------------------------------------------------------------------------------------------------------------------------------
Please see this
Pls pls help me out
thanks
praful damania
gridx=20;
gridy=20;
num=0;
for (var i=0;i < 10;i++)
{
for (var j=0;j < 10;j++)
{
dot.duplicateMovieClip("dot"+num,num);
mc=this["dot"+num];
mc._x=gridx*i;
mc._y=gridy*j;
num++;
}
}
dot._visible=0;
-------------------------------------------------------------------------------------------------------------------------------------------------------
// here i make plain circle, but problam is my all circle open in fornt side, i want to that all my circle in background
-------------------------------------------------------------------------------------------------------------------------------------------------------
//hide all selection MovieClip
for(i=1; i<=100; i++){
this.createEmptyMovieClip("test_mc"+i, this.getNextHighestDepth());
this["test"+i]._visible = false;
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
// here i make fill circle mc, all hide with this code, but problam is all circle come in background
-------------------------------------------------------------------------------------------------------------------------------------------------------
//selection area
_root.onMouseDown = function() {
sel = this.createEmptyMovieClip("sel", 1);
sel.startx = _xmouse; // we need to reference these later, so add them as properties of the selection clip
sel.starty = _ymouse;
this.onEnterFrame = function() {
with(sel){
clear();
lineStyle( 1, 000000, 100 );
moveTo(sel.startx, sel.starty);
lineTo(_xmouse, starty);
lineTo(_xmouse, _ymouse);
lineTo(sel.startx, _ymouse);
lineTo(sel.startx, sel.starty);
}
};
};
_root.onMouseUp = function() {
_root.select(sel.startx,sel.starty,sel._xmouse,sel._ymouse); // call the selection function
removeMovieClip(sel);
this.onEnterFrame = undefined;
};
_root.select = function(x1:Number,y1:Number,x2:Number,y2:Number){
// in case you dragged the selection box from right to left or bottom to top, we need
// to work out the top left and bottom right coordinates..
var sx = Math.min(x1,x2);
var ex = Math.max(x1,x2);
var sy = Math.min(y1,y2);
var ey = Math.max(y1,y2);
for(var item in this){ // loop through all items in the _root
if(typeof(this[item])=="movieclip"){ // if the current item is a movieclip..
this[item]._visible = isInside(this[item],sx,sy,ex,ey);
}
}
}
function isInside(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):Boolean{
// check whether the selection coordinates enclose the mc coordinates
return (x1<=mc._x && x2>=mc._x+mc._width && y1<=mc._y && y2>=mc._y+mc._height);
}
-------------------------------------------------------------------------------------------------------------------------------------------------------
// here u can find selection option, selection option is wroking, but same problam, it work in background, & hide my all MC (that Plain Circle also) and highlight only which we select
-------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------
// Some brif here:
i want to create plain circle in background, after that some one want to slecte that palin circle highlight that circle only with fill circle ( for better explaination see my fla file which is attach here
-------------------------------------------------------------------------------------------------------------------------------------------------------
Please see this
Pls pls help me out
thanks
praful damania