Dear All,
I did some experiments. I am complete new so I did something wrong and I can not debug it. I will explain,
1. I separated code to show description in Pic.as like this,
Code:
private function showPic():void
{
removeEventListener(Event.ENTER_FRAME,checkX);
loader.alpha=0;
loader.x=x-loader.width/2;
loader.y=y-loader.height/2;
_fla.addChild(loader);
Tweener.addTween(loader,{alpha:1,time:1,transition:'linear'});
//_fla.addThumbsEvents();
//_fla.des_txt.visible=true;
//_fla.des_txt.text=_fla.obj_array[id].des;
}
//Separating description with these lines of Code
private function showDes():void
{
_fla.addThumbsEvents();
_fla.des_txt.visible=true;
_fla.des_txt.text=_fla.obj_array[id].des;
}
//Ends Here
This came out perfect no problem since there is no major change.
2. Now I copied
Code:
private function showDes():void
{
_fla.addThumbsEvents();
_fla.des_txt.visible=true;
_fla.des_txt.text=_fla.obj_array[id].des;
}
to Main.as and gave
Code:
public function addThumbsEvents():void
{
for(var i:int=0;i
{
thumbs_array[i].mouseChildren=false;
thumbs_array[i].buttonMode=true;
thumbs_array[i].addEventListener(MouseEvent.MOUSE_OVER,showDes);
thumbs_array[i].addEventListener(MouseEvent.MOUSE_DOWN,loadPic);
}
}
public function removeThumbsEvents():void
{
for(var i:int=0;i
{
thumbs_array[i].mouseChildren=true;
thumbs_array[i].buttonMode=false;
thumbs_array[i].removeEventListener(MouseEvent.MOUSE_OVER,showDes);
thumbs_array[i].removeEventListener(MouseEvent.MOUSE_DOWN,loadPic);
}
}
Now the problem is that I am getting an error
ArgumentError: Error #1063: Argument count mismatch on org.flepstudio::Main/showDes(). Expected 0, got 1.
Anybody please can you help?
Thanks again in Advance