When flash interacts with JavaScript, the following error occurs: "The object does not support this attribute or method ".

Source: Internet
Author: User
Controlling Flash FLV video players in Javascript-open source outside China ArticleThis article introduces javas_flv_player, an open-source player, which encountered some problems during use. For example, when declaring a flash object, if the player is nested in the form, you need to use player_id to save the Flash Object immediately. Otherwise, player_id cannot be found when SWF executes the registration callback function. Because SWF is used to find the global player_id variable, it is impossible to find it in form. The error "player_id" is undefined.

If you want to hide the layers that contain flash in advance, some methods of player_id will show "The object does not support this attribute or method ". This problem has plagued me for a long time. Whether the layer is hidden or not the player_id variable looks the same. Why is there a method? This was also the case when the innerhtml method of Div was used later. After a calm analysis, I thought about the principle and finally found that the SWF was not executed. Although the object is created, the SWF in it is not executed, and some callback functions are registered for player_id in SWF. Therefore, "the object does not support this attribute or method" appears ".

To sum up, div is hidden. Although the object in it has been created, SwF is not executed. Using innerhtml to write data to an object, although the object already exists, SwF has not been executed yet. The solution is to perform subsequent operations after writing data to innerhtml. Use setTimeout ().

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.