views:

1176

answers:

2

Hi, I have a menu screen that for various reasons consists of a number of buttons as separate flash movies. When a button inside these movies is clicked, it is supposed to call a javascript function to move to the appropriate page. It works fine in firefox, but is currently failing in IE7. I don't have an IE6 handy to test on. This is the error I get in IE:

Line:1
Char:25
Error: Expected ';'
Code:0

I can't locate what char 25 of line 1 might actually mean. I only get the error when I click on the button, and after installing Visual Web Developer to try and get some actual debugging, it doesn't seem to be actually firing the function that is called, so it seems like the error is happening in whatever mechanism actually makes ExternalInterface.call work?

The code on the flash movie is literally just:

ExternalInterface.call('gohere',skip_id);

Where skip_id is passed into the movie as a flashvar - it seems to get a sensical value as I can print it to a textfield inside the flash movie. The javascript function is equally complicated:

function gohere(i){
    lo.skipto(i);
}

But as i said it doesn't even show up if I put a breakpoint here and debug it. If I put a javascript:gohere('id') link in the html screen and click that it works fine. I have ExternalInterface.call working in other parts of the same project, and can't for the life of me see any differences in the way it has been implemented.

Ideas?

A: 

I'm terrible at debugging these sorts of things even more so in IE, so for starters I would put an "alert()" in my gohere. Then I would start putting carriage returns in my javascript, and see if the line with the error moves, and figure it out by deduction.

as an aside, there is a piece of software called IETester, which should show you what your page would look like in IE 5.5/6/7/8RC1.

Assembler
Yeah, the alert() never gets fired.Finding the line is kind of complicated because the js is ajaxed and inserted into an html holder. IE seems to have trouble locating code at the best of times.
Andrew
+1  A: 

Turns out I had a - in the ID of the object tag, which IE doesn't take kindly to at all.

sigh

Andrew
Mark your own answer as accepted!
Evert