Fuunction in an other function wont start
Posted: April 8th, 2009, 2:46 am
Hey everyone.
I'm having some trouble with my script right now, i hope i'll find some help here.
I'll quicly explain my script, so you could read it faster.
I have a first window opening (selection_jour), wich is my firtst selection.
I want my user to select wich day is it, then, i mask/unmask the text layer in apropriate comp, to match the choice.
(this works for now)
On the click on the different button, the window is closed, the layers are updated, and my second windows shows up.
In this second window (fenetre_region_aprem), i want my user to enter the temperature for different locations; an select in a dropdown list, some images to match his choice.
The window is build proprely (i used rapidscruitUI to design it).
But, and thers is my problem :
I cant assign any action to my "valider" button... I tried a simple alert, and it dosnt even works...;
I cant find out what i did wrong, and i hope u'll see it ^^
Here is an image :
Here is my code :
I have a last question.
How could i get the values the user entered in edittext area?
Thanks a lot in advance to whoever take the time to read this. (and sorry for my frenchy english)
Djbennyj.
I'm having some trouble with my script right now, i hope i'll find some help here.
I'll quicly explain my script, so you could read it faster.
I have a first window opening (selection_jour), wich is my firtst selection.
I want my user to select wich day is it, then, i mask/unmask the text layer in apropriate comp, to match the choice.
(this works for now)
On the click on the different button, the window is closed, the layers are updated, and my second windows shows up.
In this second window (fenetre_region_aprem), i want my user to enter the temperature for different locations; an select in a dropdown list, some images to match his choice.
The window is build proprely (i used rapidscruitUI to design it).
But, and thers is my problem :
I cant assign any action to my "valider" button... I tried a simple alert, and it dosnt even works...;
I cant find out what i did wrong, and i hope u'll see it ^^
Here is an image :
Here is my code :
Code: Select all
function alert(){
fenetre_region_aprem();
rapidDlg.hide();
alert("Value:"+rapidDlg.groupe1.Panel1.EditText1.textField.text);
alert("test");
}
function BTabout()
{
alert("");
}
function BTlundi()
{
//Activer le lundi
for (i=2;i<6;i++)
{
mycomp = app.project.item(i);
mycomp.layer(8).enabled = true;
mycomp.layer(9).enabled = false;
mycomp.layer(10).enabled = false;
mycomp.layer(11).enabled = false;
mycomp.layer(12).enabled = false;
}
Remplir();
}
function BTmardi()
{
//Activer le lundi
for (i=2;i<6;i++)
{
mycomp = app.project.item(i);
mycomp.layer(9).enabled = true;
mycomp.layer(8).enabled = false;
mycomp.layer(10).enabled = false;
mycomp.layer(11).enabled = false;
mycomp.layer(12).enabled = false;
}
Remplir();
}
function BTmercredi()
{
//Activer le lundi
for (i=2;i<6;i++)
{
mycomp = app.project.item(i);
mycomp.layer(10).enabled = true;
mycomp.layer(8).enabled = false;
mycomp.layer(9).enabled = false;
mycomp.layer(11).enabled = false;
mycomp.layer(12).enabled = false;
}
Remplir();
}
function BTjeudi()
{
//Activer le lundi
for (i=2;i<6;i++)
{
mycomp = app.project.item(i);
mycomp.layer(11).enabled = true;
mycomp.layer(8).enabled = false;
mycomp.layer(10).enabled = false;
mycomp.layer(9).enabled = false;
mycomp.layer(12).enabled = false;
}
Remplir();
}
function BTvendredi()
{
//Activer le lundi
for (i=2;i<6;i++)
{
mycomp = app.project.item(i);
mycomp.layer(12).enabled = true;
mycomp.layer(8).enabled = false;
mycomp.layer(10).enabled = false;
mycomp.layer(11).enabled = false;
mycomp.layer(9).enabled = false;
}
Remplir();
}
function fenetre_region_aprem(){
rapidDlg.minimumSize= [250,350];
rapidDlg.maximumSize= [200,0];
rapidDlg.orientation = "column";
tableau_temps =["Soleil","pluie","Soleil et pluie","soleil voilé","gros nuages blancs","gros nuages noirs","neige","orage","soleil et nuage","soleil et neige"];
// Properties for rapidDlg.groupe1
rapidDlg.groupe1 = rapidDlg.add('group',undefined);
rapidDlg.groupe1.alignChildren = ['left','top'];
rapidDlg.groupe1.orientation = "column";
// Properties for rapidDlg.groupe1.Panel1
rapidDlg.groupe1.Panel1 = rapidDlg.groupe1.add('panel',undefined,"Chartre");
rapidDlg.groupe1.Panel1.minimumSize= [180,40];
rapidDlg.groupe1.Panel1.alignChildren = ['left',' '];
rapidDlg.groupe1.Panel1.orientation = "row";
// Properties for rapidDlg.groupe1.Panel1.StaticText1
rapidDlg.groupe1.Panel1.StaticText1 = rapidDlg.groupe1.Panel1.add('statictext',undefined,"T°");
// Properties for rapidDlg.groupe1.Panel1.EditText1
rapidDlg.groupe1.Panel1.EditText1 = rapidDlg.groupe1.Panel1.add('edittext',undefined," ");
// Properties for rapidDlg.groupe1.Panel1.DropDownList1
rapidDlg.groupe1.Panel1.DropDownList1 = rapidDlg.groupe1.Panel1.add('dropdownlist',undefined, tableau_temps);
// Properties for rapidDlg.groupe1.Panel2
rapidDlg.groupe1.Panel2 = rapidDlg.groupe1.add('panel',undefined,"Orleans");
rapidDlg.groupe1.Panel2.minimumSize= [180,40];
rapidDlg.groupe1.Panel2.alignChildren = ['left',' '];
rapidDlg.groupe1.Panel2.orientation = "row";
// Properties for rapidDlg.groupe1.Panel2.StaticText2
rapidDlg.groupe1.Panel2.StaticText2 = rapidDlg.groupe1.Panel2.add('statictext',undefined,"T°");
// Properties for rapidDlg.groupe1.Panel2.EditText2
rapidDlg.groupe1.Panel2.EditText2 = rapidDlg.groupe1.Panel2.add('edittext',undefined," ");
// Properties for rapidDlg.groupe1.Panel2.DropDownList2
rapidDlg.groupe1.Panel2.DropDownList2 = rapidDlg.groupe1.Panel2.add('dropdownlist',undefined, tableau_temps);
// Properties for rapidDlg.groupe1.Panel3
rapidDlg.groupe1.Panel3 = rapidDlg.groupe1.add('panel',undefined,"Blois");
rapidDlg.groupe1.Panel3.minimumSize= [180,40];
rapidDlg.groupe1.Panel3.alignChildren = ['left',' '];
rapidDlg.groupe1.Panel3.orientation = "row";
// Properties for rapidDlg.groupe1.Panel3.StaticText3
rapidDlg.groupe1.Panel3.StaticText3 = rapidDlg.groupe1.Panel3.add('statictext',undefined,"T°");
// Properties for rapidDlg.groupe1.Panel3.EditText3
rapidDlg.groupe1.Panel3.EditText3 = rapidDlg.groupe1.Panel3.add('edittext',undefined," ");
// Properties for rapidDlg.groupe1.Panel3.DropDownList3
rapidDlg.groupe1.Panel3.DropDownList3 = rapidDlg.groupe1.Panel3.add('dropdownlist',undefined, tableau_temps);
// Properties for rapidDlg.groupe1.Panel4
rapidDlg.groupe1.Panel4 = rapidDlg.groupe1.add('panel',undefined,"Tours");
rapidDlg.groupe1.Panel4.minimumSize= [180,40];
rapidDlg.groupe1.Panel4.alignChildren = ['left',' '];
rapidDlg.groupe1.Panel4.orientation = "row";
// Properties for rapidDlg.groupe1.Panel4.StaticText4
rapidDlg.groupe1.Panel4.StaticText4 = rapidDlg.groupe1.Panel4.add('statictext',undefined,"T°");
// Properties for rapidDlg.groupe1.Panel4.EditText4
rapidDlg.groupe1.Panel4.EditText4 = rapidDlg.groupe1.Panel4.add('edittext',undefined," ");
// Properties for rapidDlg.groupe1.Panel4.DropDownList4
rapidDlg.groupe1.Panel4.DropDownList4 = rapidDlg.groupe1.Panel4.add('dropdownlist',undefined, tableau_temps);
// Properties for rapidDlg.groupe1.Panel5
rapidDlg.groupe1.Panel5 = rapidDlg.groupe1.add('panel',undefined,"Sud");
rapidDlg.groupe1.Panel5.minimumSize= [180,40];
rapidDlg.groupe1.Panel5.alignChildren = ['left',' '];
rapidDlg.groupe1.Panel5.orientation = "row";
// Properties for rapidDlg.groupe1.Panel5.StaticText5
rapidDlg.groupe1.Panel5.StaticText5 = rapidDlg.groupe1.Panel5.add('statictext',undefined,"T°");
// Properties for rapidDlg.groupe1.Panel5.EditText5
rapidDlg.groupe1.Panel5.EditText5 = rapidDlg.groupe1.Panel5.add('edittext',undefined," ");
// Properties for rapidDlg.groupe1.Panel5.DropDownList5
rapidDlg.groupe1.Panel5.DropDownList5 = rapidDlg.groupe1.Panel5.add('dropdownlist',undefined, tableau_temps);
// Properties for rapidDlg.groupe2
rapidDlg.groupe2 = rapidDlg.add('group',undefined);
rapidDlg.groupe2.alignChildren = ['left','top'];
rapidDlg.groupe2.orientation = "row";
rapidDlg.groupe2.Button1 = rapidDlg.groupe2.add('button',undefined,"Valider");
rapidDlg.groupe2.Button1.alignment = ['left','fill'];
rapidDlg.groupe2.Button2 = rapidDlg.groupe2.add('button',undefined,"Cancel");
rapidDlg.groupe2.Button2.alignment = ['right','middle'];
rapidDlg.groupe2.Button1.onClick = alert;
//Properties for rapidDlg.groupe3 Image1
/* rapidDlg.groupe3 = rapidDlg.add('group',undefined);
rapidDlg.groupe3.alignChildren = ['left','top'];
rapidDlg.groupe3.orientation = "row";
rapidDlg.groupe3.Image1 = rapidDlg.groupe3.add('image',undefined,"~/Desktop/images/logotvo.jpg");
*/
}
function fenetre_selection_jour()
{
pal_jour.lol = pal_jour.add("statictext",[10,5,140,25],"Selection du jour");
pal_jour.BTlundi= pal_jour.add("button",[10,30,100,50],"Lundi");
pal_jour.BTmardi= pal_jour.add("button",[10,70,100,50],"mardi");
pal_jour.BTmercredi= pal_jour.add("button",[10,110,100,50],"mercredi");
pal_jour.BTjeudi= pal_jour.add("button",[10,150,100,50],"jeudi");
pal_jour.BTvendredi= pal_jour.add("button",[10,190,100,50],"vendredi");
pal_jour.BTabout = pal_jour.add("button",[70,230,20,50],"?");
pal_jour.BTabout.onClick = BTabout;
pal_jour.BTlundi.onClick = BTlundi;
pal_jour.BTmardi.onClick = BTmardi;
pal_jour.BTmercredi.onClick = BTmercredi;
pal_jour.BTjeudi.onClick = BTjeudi;
pal_jour.BTvendredi.onClick = BTvendredi;
pal_jour.center();
}
function Remplir()
{
fenetre_selection_jour();
pal_jour.hide();
fenetre_region_aprem();
rapidDlg.show();
}
var pal_jour = new Window("palette","Choix jour",[0,0,110,260]);
var rapidDlg = new Window('palette',"Region centre apres midi",undefined);
fenetre_selection_jour();
pal_jour.show();
I have a last question.
How could i get the values the user entered in edittext area?
Thanks a lot in advance to whoever take the time to read this. (and sorry for my frenchy english)
Djbennyj.