HI ,
I am having some n number of images.I want to alter the positions.I done the functionality.But if load the images it’s not working.I will give the whole code.Please help me.The images should be drag and drop
The code is
var xPos:Number =10;
var yPos:Number = 10;
var nofImage:Number = 5;
var boolHit:Boolean = false;
var arrImage:Array = new Array;
var imgStr:String =“SOCCER-01.png,SOCCER-02.png,SOCCER-03.png,SOCCER-04.png,SOCCER-05.png,SOCCER-06.png”
var imgArr:Array = new Array();
imgArr = imgStr.split(",");
var container;
for(var i=0;i<imgArr.length;i++){
this.attachMovie(“blueMovie”,“blueMovie”+i,this.getNextHighestDepth());
this[“blueMovie”+i].loadMovie(imgArr*)//“This is the line i load the image, without this line the movieclip is working fine.”
this[“blueMovie”+i]._x = xPos ;
this[“blueMovie”+i]._y = yPos ;
this[“blueMovie”+i].txt.text = imgArr*;
yPos = this[“blueMovie”+i]._y + this[“blueMovie”+i]._height + 80;
this[“blueMovie”+i].ind = i;
_root.arrImage.push(i);
this[“blueMovie”+i].onPress = function(){
startDrag(this);
xPos = this._x;
yPos = this._y;
this.swapDepths(_root.nofImage+1);
};
this[“blueMovie”+i].onReleaseOutside = function(){
stopDrag();
this._x = xPos;
this._y = yPos;
}
this[“blueMovie”+i].onRelease = function(){
stopDrag();
boolHit = false;
for(var i=0;i<imgArr.length;i++){
if(this.ind != _root[“blueMovie”+i].ind){
if (this.hitTest(_root[“blueMovie”+i])) {
boolHit = true;
xPos = 10;
yPos = 10;
var tempIns = _root.arrImage.splice(this.ind,1);
_root.arrImage.splice(_root[“blueMovie”+i].ind,0,tempIns);
break;
}
}
}
if(_root.boolHit == false){
this._x = xPos;
this._y = yPos;
}
else{
for(var i=0;i<_root.arrImage.length;i++){
_root[“blueMovie”+_root.arrImage*].ind = i;
_root[“blueMovie”+_root.arrImage*]._x = xPos;
_root[“blueMovie”+_root.arrImage*]._y = yPos;
yPos = _root[“blueMovie”+_root.arrImage*]._y + _root[“blueMovie”+_root.arrImage*]._height + 80;
}
}
};
}