PDA

View Full Version : Dynamic text and buttons..


Casey Green
05-03-2003, 11:24 PM
I've made a dynamic text field and button.i set when rollover on button title appears, when rollout it disappears, but what should i do to make it stay when i press the button ?

ps there is also:
on (press) {
loadVariablesNum("1.txt",0)
}

pellepiano
05-04-2003, 04:47 PM
Always include your script ( then you could just copy and paste the answer to your file). Now you have to change the variable names and stuff as we have to guess what your code is.

on(rollOver){
mytextField="Something";
}
on(rollOut){
if(delete!=1){
mytextField="";
}
}
on(press){
mytextField="Something";
delete=1;
}

Casey Green
05-04-2003, 06:13 PM
there's another problem, when i'm scrolling text and leave it anywhere, let's say in the end.. and when i press another button and there is new text i see it from the end as i left on the one i've read before :(

pellepiano
05-04-2003, 06:52 PM
Try adding a ....

myTextField.scroll=1;

..to the buttons.

Casey Green
05-04-2003, 07:49 PM
can you tell me more clearly cause im a noob :eek: where should i put it/

CyanBlue
05-04-2003, 09:43 PM
when i press another buttonThat's where you should put that code... Right after you load text content into the text field you are scrolling...

Casey Green
05-05-2003, 12:31 PM
this script is on buttons

on (press) { loadVariablesNum("1.txt",0) }
on (rollOver){
pav="one two.."
}
on (rollOut){
pav=""
}

where should i add text.scroll=1; ?

CyanBlue
05-05-2003, 12:37 PM
Right below the loadVariablesNum() function line... ;)

Casey Green
05-05-2003, 04:40 PM
heh thanks dudes it worked, but what about main problem which i asked in first post? :rolleyes:

pellepiano
05-05-2003, 04:54 PM
What about the answer in the second post?

Casey Green
05-05-2003, 06:56 PM
Originally posted by pellepiano
What about the answer in the second post?

it doesn't work, dunno why

pellepiano
05-05-2003, 07:07 PM
This should work ( "delete" is a restricted word , that was whats wrong).

on (rollOver) {
mytextField = "Something";
}
on (rollOut) {
if (kill != 1) {
mytextField = "";
}
}
on (press) {
mytextField = "Something";
kill = 1;
}

Casey Green
05-05-2003, 07:40 PM
when you press button title stays - good, when you rollover other button title changes - ok, but when you rollout(without pressing it)that button title stays - not good :). rollout action doesn't work anymore after the firt press.

pellepiano
05-05-2003, 07:48 PM
Then just add another kill variable.

on (rollOver) {
kill=0;
mytextField = "Something";
}
on (rollOut) {
if (kill != 1) {
mytextField = "";
}
}
on (press) {
mytextField = "Something";
kill = 1;
}

Casey Green
05-05-2003, 08:04 PM
thanx now it works just fine