zerooito
04-07-2003, 07:13 PM
Well, folks... I have a default listBox named msg_queue.
and I made this:
keyboard = {};
keyboard.onKeyDown = function(){
var temp;
temp = String.fromCharCode((random(25)+65));
temp += String.fromCharCode((random(25)+65));
msg_queue.addItem(temp);
}
Key.addListener(keyboard);
This code will add a random two character Item to my
msg_queue listBox, everytime a key is pressed.
I made this just for testing my application.
and so, I added one button named bt_erase the code for it is:
bt_erase.onRelease = function(){
var actual_index = msg_queue.getSelectedIndex();
msg_queue.removeItemAt(actual_index);
}
As I press any key, it will add one Item,
and as I select any item and click to erase,
it will remove the selected item from the listbox.
This thing works fine.
but if I add some 5 items (for example), revome them all,
and try to add another item, my application stops running,
like it was running an infinite loop. flash says:
"A script in this movie is causing Flash Player to run slowly.
If it continues to run, you computer may become unresponsive.
Do you want to abort the script?"
Iīve already fixed the problem, but this doesnīt make sense.
why the heck it isnīt working?
thanx!
zerooito
and I made this:
keyboard = {};
keyboard.onKeyDown = function(){
var temp;
temp = String.fromCharCode((random(25)+65));
temp += String.fromCharCode((random(25)+65));
msg_queue.addItem(temp);
}
Key.addListener(keyboard);
This code will add a random two character Item to my
msg_queue listBox, everytime a key is pressed.
I made this just for testing my application.
and so, I added one button named bt_erase the code for it is:
bt_erase.onRelease = function(){
var actual_index = msg_queue.getSelectedIndex();
msg_queue.removeItemAt(actual_index);
}
As I press any key, it will add one Item,
and as I select any item and click to erase,
it will remove the selected item from the listbox.
This thing works fine.
but if I add some 5 items (for example), revome them all,
and try to add another item, my application stops running,
like it was running an infinite loop. flash says:
"A script in this movie is causing Flash Player to run slowly.
If it continues to run, you computer may become unresponsive.
Do you want to abort the script?"
Iīve already fixed the problem, but this doesnīt make sense.
why the heck it isnīt working?
thanx!
zerooito