Wednesday, April 12, 2006

Flash Quirk: ExternalInterface IE "Expected ;" Bug

This information applies to Flash Player 8,5,0,246 and may also apply to other versions.

If you use an integer for the id of your swf object element, ExternalInterface.call will fail and IE will report a script error:

Expected: ';'

The solution is to not use integers for element ids.

Was this post helpful to you? If so, please consider making a small donation to keep this blog going.

14 Comments:

Anonymous Anonymous said...

This frustrated the bejezzus out of me. Solution works like a charm, thank you SO much.

8:53 AM  
Blogger Nicolas said...

Hey thanks, this just helped me to find the problem.

A space in the name was creating the problem, so it's not just integer.

11:30 AM  
Anonymous Anonymous said...

You lifesaver!

I had an integer as the first character and it threw the error

10:49 AM  
Anonymous Anonymous said...

You absolute legend!! I was pulling my hair out about that one ... to the point where i forlornly googled "ie expected ;" ... and ended up finding this life-saving site! Thank you soooooo much for documenting this peice of IE nonsense

6:30 AM  
Anonymous Anonymous said...

OMG - thank you for this.

Spent hours figuring out the IE 508 char limit on a javascript call in getURL - switched to ExternalInterface.call all beautiful until this error popped up.

Dont want to think how long I could have spent working on this...

thanks again

6:18 AM  
Anonymous Anonymous said...

I love you. (02:00, friday morning. Will you marry me?)

5:18 PM  
Blogger Unknown said...

Ditto to what everyone else said (except the marriage bit).

So glad you posted that. Thanks!

10:41 AM  
Blogger Johan and Lia said...

I'll sing a lovesong to you on stage-gf will have to understand. Thanks mate!!

3:22 AM  
Blogger Casper Fabricius said...

Yes, brilliant. Seems like the id part must be a valid variable name (not start with an integer, only a-z, 0-9 and _).

4:22 AM  
Anonymous Anonymous said...

OOOOOOhhhhh yesss! Oh God that feels SOO GOOOD!

I'm a straight dude and I'd marry you. How did you figure this out?

Somehow, IE never fails to screw with developers heads.

7:59 PM  
Blogger Pierce said...

Thanks for this. Also, as casper mentioned above, the id needs to be a valid variable. I was seeing this happen when the id had slashes in it.

9:37 AM  
Anonymous Anonymous said...

This post just saved my hair!!
It also happens if you have a whitespace in the ID e.g "My Movie" vs "myMovie".
Very, very, very stupid IE. Bad, bad.

3:42 AM  
Anonymous Anonymous said...

I have no idea what i need to do?

getURL(http://http://www.jtf.org);

is there something i need to change in this?

PLEASE help

11:02 PM  
Anonymous Anonymous said...

Like the others here, a thousand thanks for helping me out. I was using

"flash_0.1237897234" as my ID, calling Math.rand().toString.

The decimal point was tripping things up, so it's probably gotta be a value that could be a valid javascript variable.

3:11 PM  

Post a Comment

<< Home