This bug is actually more weird than you would think - it's not the
passing of a string with a hypen that is causing the problem - it's
simply a SWF with a hyphen calling any externalInterface call.

Try this test:

create a new Flash file - make sure you name it with a hypen in it eg.
"test-1.swf"
Then put this code in it...

import flash.external.*
ExternalInterface.call("alert","Hello");

Run it in IE embedded in a HTML page. You will get a javascript error.
Firefox no error.
(I think only Flash Player 9 causes this error but unsure)

Now re-publish your file without a hypen in it and run it again from
IE and it will work fine.






On 12/6/06, T. Michael Keesey <[EMAIL PROTECTED]> wrote:
Well, one idea that comes to mind is that you could escape the
filename (using the escape() function) before sending it through
ExternalInterface, and then unescape it in JavaScript. Hyphens do not
get converted by ActionScript's escape() function, but you can force
it like so:

ExternalInterface.call("myJSFunc", escape(s).replace("-", "%2D"));

Then, in JavaScript:

function myJSFunc(filename) {
    filename = unescape(filename);
    // Continue....
}

On 12/6/06, Mick G <[EMAIL PROTECTED]> wrote:
> Does anyone know of a work-around to this bug:
> http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=4b687833
>
> I'm getting javascript errors in IE using externalInterface and SWF
> file names that have a hyphen in them. Unfortunately I'm working with
> a content management system that renames SWF's to files with hypens in
> them.
>
> This is not a well known bug but I've seen many threads with people
> getting these JS errors in IE using externalInterface. It's caused me
> grief quite a few times. Usually renaming my SWF without a hypen works
> except in this case when I can't.
>
> - Mick
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>


--
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry & Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to