After a few hours, I found out that the road was wrong.
There is a problem with testing a JavaScript method to call an object in Flash on a Firefox browser today.
I had a whole afternoon of doing it.
I remember not having had such a problem before when I used Flash8.
My program is like this, I used flash to create a menu, by default, when the page opens, the menu is hidden, when the mouse is placed on a small icon, the menu is displayed, and will be based on the current page data situation, display a few items in the menu, while hiding a few items do not need to display the menu.
I used externalinterface.addcallback in Flash to register a method called: setmenuitemvisible (B:boolean)
Intended to be called in JavaScript in a Web page.
But who knows the program to write well, in the Internet Explorer run all normal, but in Firefox always prompt error:
The Setmenuitemvisible () method cannot be called in JavaScript.
I began to search Baidu, looking for one hours later, finally found a paper:
Http://www.coolcode.cn/show-291-1.html
I have this piece of content in my Baidu space to collect a bit:
Http://hi.baidu.com/personnel/blog/item/8c04cd119effe919b8127b47.html
Originally because of browser reasons, if you do JavaScript on most browsers outside of IE call the function in Flash, generally in window.onload=function () {Load Flash}
Otherwise, some external functions that are registered in Flash cannot be called in JavaScript.
It was thought that the reason for this was found, but then came a very headache problem.
Because my flash is hidden first, after the JavaScript triggers the event, it only shows that I am using the
Flash.style.display= "None";
Flash.style.display= "";
When testing on Firefox found that when in this show and hide the two state of the transition, each flash will reload once, really faint!
Then to Baidu search a bit, found such an article, now I collected a bit:
Http://hi.baidu.com/personnel/blog/item/a8f40fb3025decaed8335a43.html
The flash code was eventually rewritten because the previous code was logically not a good idea on Firefox.
2009-08-12
JavaScript calls the Flash object's method (function) for five hours.