EventListener working 95% of the time in IE but only 2% in Firefox?

I have no clue how to even begin to debug this. The problem
is much more common in Firefox than in IE, but it does happen in
both.
The critical problem is that my EventListener function
startChatClickHandler is not triggered 98% of the time in Firefox
and about 5% of the time in IE. Even the Alert box doesn't trigger.
I can click on it all day in Firefox and it just sits there though
once ever while it works but never more than once. But if I right
click on it, then select Rewind, it will work 100% - at least till
I try it again. That must be a clue but I have no idea what it
means. Also, it used to work just fine but one of my changes must
have had a unintented effect but I can't seem to fix it. Also, I've
had the same results on more than one PC.
Another possible clue is that if I hit the enter key instead,
that works 100% of the time in both Firefox and IE, even though all
it does is pass it on to the EventListener function
startChatClickHandler. It's like it's just not "hearing" the mouse
clicks most of the time.
The instance of the button is called startChatButton and
userNameInput is a instance of a TextInput. The code for this
section is below.
I've struggled with this for 12 hours straight and I am at my
wits end. Anyone who can help with this will have my undying
gratitude.
import mx.controls.Alert;
var mainpicpath:String;
var loadit_lv:LoadVars = new LoadVars();
var userdata_so:SharedObject =
SharedObject.getLocal("user_data");
var tempName:String;
//var buttonlistenerObject:Object = new Object();
profileText.text = "Still loading...";
userNameInput.text = chatName;
tempName = userdata_so.data.chatname;
if (tempName.length > 0)
userNameInput.text = tempName;
profileText.text = "Profile text failed to load.";
function startChatClickHandler (evt:Object):Void // <-----
HERES THE PART THAT ONLY SOMETIMES GETS TRIGGERED, MUCH WORST IN
FIREFOX
Alert.show("function click triggered","Info");
_global.userName = userNameInput.text;
if (_global.userName.length > 0)
userdata_so.data.chatname = userNameInput.text;
userdata_so.flush();
else
_global.userName = "Guest";
nc.connect("rtmp://my flash media server);
startChatButton.addEventListener("click",
startChatClickHandler);
function enter(ev)
Alert.show("function enter triggered","Info");
startChatClickHandler(ev);
userNameInput.addEventListener("enter", this); //<----
THIS ALWAYS WORKS
function onConnect(ev)
//Alert.show("You are connected to: " + nc.uri,
"Information");
gotoAndPlay("Main");
mainpicpath = "
http://www.mywebsite.com/site_images/profiles/mainpic-"
+ channel + ".jpg";
loadMovie(mainpicpath, "loginpic");
loadit_lv.onData = function(src:String)
if (src != undefined)
profileText.text = src;
else
profileText.text = "Error loading profile text.";
loadit_lv.load("
http://www.mywebsite.com/profiletext/"
+ channel + ".txt");
And this is how the flash movie is called from Perl:
print qq{<object
classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="
http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="720" height="500" id="customer_v16b" align="middle">};
print qq{<param name="allowScriptAccess"
value="sameDomain" />};
print qq{<param name="movie" value="
http://www.mywebsite.com/flash/customer_v16b.swf?dummyVar=$dummy"
/>};
print qq{<param name="FlashVars"
value="channel=$host_page&hostName=$profile_info{'
name'}&chatName=$chat_name">};
print qq{<param name="quality" value="high" />};
print qq{<param name="bgcolor" value="#FFFFFF" />};
print qq{<embed src="
http://www.mywebsite.com/flash/customer_v16b.swf?dummyVar=$dummy"
FlashVars="channel=$host_page&hostName=$profile_in
fo{'name'}&chatName=$chat_name" quality="high"
bgcolor="#FFFFFF" width="720" height="500" name="customer_v16b"
align="middle" allowScriptAccess="sameDomain"
type="application/x-shockwave-flash" pluginspage="
http://www.macromedia.com/go/getflashplayer"
/>};
print qq{</object>};

I stripped almost all the code out and verified I could click
on the button and that it was working correctly.
Then I started adding things back in till it broke again.
Heres as much of the original code that I could put back
without breaking it:
import mx.controls.Alert;
var mainpicpath:String;
var loadit_lv:LoadVars = new LoadVars();
var userdata_so:SharedObject =
SharedObject.getLocal("user_data");
var tempName:String;
//var buttonlistenerObject:Object = new Object();
profileText.text = "Still loading...";
userNameInput.text = chatName;
tempName = userdata_so.data.chatname;
if (tempName.length > 0)
userNameInput.text = tempName;
profileText.text = "Profile text failed to load.";
function startChatClickHandler (evt:Object):Void
Alert.show("function click triggered","Info");
_global.userName = userNameInput.text;
if (_global.userName.length > 0)
userdata_so.data.chatname = userNameInput.text;
userdata_so.flush();
else
_global.userName = "Guest";
//nc.connect('rtmp:/GPL_chat_alpha/chat',
_global.userName,"customer",hostName);
nc.connect("rtmp://myflashmediaserver",
_global.userName,"customer",hostName,channel);
startChatButton.addEventListener("click",
startChatClickHandler);
function onConnect(ev)
//Alert.show("You are connected to: " + nc.uri,
"Information");
gotoAndPlay("Main");
The following sections of code will break it (in that
clicking on the button no longer does anything), either together or
one at a time:
function enter(ev)
Alert.show("function enter triggered","Info");
startChatClickHandler(ev);
userNameInput.addEventListener("enter", this);
mainpicpath = "
http://www.girlsplaylive.com/site_images/profiles/mainpic-"
+ channel + ".jpg";
loadMovie(mainpicpath, "loginpic");
loadit_lv.onData = function(src:String)
if (src != undefined)
profileText.text = src;
else
profileText.text = "Error loading profile text.";
loadit_lv.load("
http://www.girlsplaylive.com/profiletext/"
+ channel + ".txt");
So the question is why does this happen and whats the best
way to fix it?

Similar Messages

Maybe you are looking for

  • Oracle Query failing for multiple rows:

    Hey Guys, I have been given a task to produce an ad-hoc report based on the following conditions (I will give you the structure of the table and details in the table below the requirements) Requirements: Adhoc Report for Audit on CIT Income Allocatio

  • Final Cut Express HD transfer from Intel to new Retina MacBook Pro

    Final cut express HD will not open on new macbook retina using my intel version serial number.  Do I have to purchase it again!!?

  • XI2.0 to PI 7.0

    Hi All,            Good Day,at the moment we having XI2.0 system and client want to upgrade to PI 7.0 .first of all is this upgrading is going to work with old interfaces.if yes what are the steps we have to take to upgrade from 2.0 to 7.0 and what t

  • PRT Rounting prob for counter updation for Repetitive manufacturing

    Hi Experts, Is it possible to do update measuring counter thr production specially in case of Repetitive manufacturing scenario .If we try the same counter thr discrete then it will update the counter . Pl guide ,is there any customization for these

  • Can't connect to iCloud after mountain lion install

    After installing mountain lion I can use iCloud. I keep getting this pope up that this mac can't connect to icloud due to a problem with my e-mail account and suggest to open icloud preference to fix it. Then I get asked my passward which it does't a