|
-
Dynamic Input problem
I have a dynamic text field in a movie clip called "connect"
I want 1 of 4 possible text messages to appear in that dynamic field I called "connectTxt", based on a response from a database.....
if I get just one to dynamically appear, thats great...
they are...
1) waiting
2) connecting...
3) Connection failed
4) Connected
having problems coding this...can someone help me out...?
Im using Flash 8 by the way...
Thanks so much...
-
If you can, post what you have so far? and we can work from there. What method are you using
the main thing you would do is to assign the text to the text field based on what you get from the database so you would use if statements or select case.
if(database response== waiting condition){
connectTxt.txt = "waiting";
}
-
Hi, i like that if statement...
I have this now, and it works...but i'd love to include the if.......how would i go about it.....
here's what I have so far......
Thanks again...
aMsgs = new Array();
aMsgs[0]="Attempting to connect to server...";
aMsgs [1]="Login succeeded";
aMsgs [2]="Login failed";
function showMessage(msgNum){
connect.connectTxt.text = aMsgs[msgNum];
}
showMessage(0);
showMessage(1);
showMessage(2);
-
Where have you placed the test for the database response? The code you have there will work well in conjunction with if statements. What you would do it to place the if statements to assign what message to show.
Code:
aMsgs = new Array();
aMsgs[0]="Attempting to connect to server...";
aMsgs [1]="Login succeeded";
aMsgs [2]="Login failed";
function showMessage(msgNum){
connect.connectTxt.text = aMsgs[msgNum];
}
if(condition 1){
showMessage(0);
}else if(condition 2){
showMessage(1);
}else if(condition 3){
showMessage(2);
}
-
couldnt get the if statement to work...
thanks though...I have another problem on top of that
I have a button that must be enabled when the connection condition is met...
I have this now...and it didnt work...
Can u help....
aMsgs = new Array();
aMsgs[0]="Attempting to connect to server...";
aMsgs [1]="Login succeeded";
aMsgs [2]="Login failed";
function showMessage(msgNum){
connect.connectTxt.text = aMsgs[msgNum];
}
showMessage(0);
showMessage(1);
showMessage(2);
function setConnectButtonEnabled(isEnabled:Boolean):Void
{
connect.btnConnect.gotoAndStop(
isEnabled ? "ACTIVE" : "DISABLED");
if(MsgNum<2)
{
setConnectButtonEnabled(fnArgs == "true" ? true : false);
}
}
-
You won't need all of this code below:
Code:
function setConnectButtonEnabled(isEnabled:Boolean):Void
{
connect.btnConnect.gotoAndStop(
isEnabled ? "ACTIVE" : "DISABLED");
if(MsgNum<2)
{
setConnectButtonEnabled(fnArgs == "true" ? true : false);
}
replace that whole section with the following:
Code:
if(MsgNum<2)
{
connect.btnConnect._enabled = true;
}else{
connect.btnConnect._enabled = false;
}
Last edited by VI Knight; 08-03-2006 at 11:28 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|