trying to create color book
i like to share with you the link with the color book.
http://hebrewgames.org/colorbook/clorbooktest
i have in the labrary 2 pictures
every picture has a linkage name (pic1, pic2)
each part in pic1 has a movie clips name by a1 a2 a3 a4 ...
each part in pic2 has a movie clips name by a1 a2 a3 a4 ...
when i am loading pic1 all work i can chage the color.
when i click new pic buton
pic1 removed and place pic2
the prablem is: that now the color not chnage. it does not recognize the a1 instanc name in pic2.
--------------------------------------------------
this is the code
this.stop();
root=this;
var picNum=1;
var MyInstance = new lib["pic"+1]();
var MyInstance1 = new lib["pic"+2]();
//var MyInstance2 = new lib["pic"+3]();
// var MyInstance3 = new lib["pic"+4]();
this.addChild(MyInstance);
MyInstance.x=170;
MyInstance.y=60;
MyInstance.a1.addEventListener("click", a_1.bind(this));
function a_1()
{
alert ("hello1");
MyInstance.a1.shape.graphics._fill.style ="#ff0000";
}
MyInstance.a2.addEventListener("click", a_2.bind(this));
function a_2()
{
alert ("hello2");
MyInstance.a2.shape.graphics._fill.style ="#ff00ff";
}
MyInstance.a3.addEventListener("click", a_3.bind(this));
function a_3()
{
alert ("hello3");
MyInstance.a3.shape.graphics._fill.style ="#000123";
}
MyInstance.a4.addEventListener("click", a_4.bind(this));
function a_4()
{
alert ("hello4");
MyInstance.a4.shape.graphics._fill.style ="#6699cc";
}
this.npic.addEventListener("click", newPic.bind(this));
function newPic()
{
alert ("new Picture");
root.removeChild(MyInstance);
MyInstance=null;
picNum=2;
MyInstance = new lib["pic"+picNum]();
//MyInstance.name="newpp";
root.addChild(MyInstance);
MyInstance.x=370;
MyInstance.y=60;
MyInstance["a"+picNum+4].shape.graphics._fill.style ="#6699cc";
}
