Add to Favorites | Home page now a lot of sites, whether large or small personal homepage has set the homepage and add favorites, although the practicality is worth exploring but still for the Web page added effect. Can you add such a feature to the Flash animation? And how do you implement these two functions? Let's learn how to achieve both of these effects.
In Flash we use ActionScript scripts to achieve both of these effects by setting the page as the homepage and adding favorites here are two ways. The first method is implemented through the Geturl of the button, as long as the corresponding ActionScript script is added to the button. The script is as follows:
Set as homepage On (release) {GetURL ("
JavaScript: void (document.links[0].style.behavior= ' ' "' url (#default #homepage) '"); void Document.links[0]. setHomePage (' ' http://your website address/' "')", "_self", "POST"); }
Join Favorites On (release) {GetURL ("
JavaScript: void Window.external.AddFavorite (' ' ' http://your website address ' "', ' ' ', ' ' ' ' '" ' "' Website Name '" ') ', "_self", "POST"); The second method is more complex by using the Fscommand method than the one above. First add ActionScript script code to the Flash button
Set as homepage On (release) {Fscommand ("setHomePage", "http://your website address");}
Join Favorites On (release) {Fscommand ("Addfavorite", "http://Web address | site name");}
When you publish Flash animations, choose HTML, Flash with Fscommand in the template drop-down menu, publish HTML pages and then modify the published HTML page to find a paragraph in the HTML code
Handle all the "Fscommand messages in a Flash movie function Sethomepage_dofscommand (command, args) {}
This section is modified to//Handle all of the the Fscommand messages in a Flash movie function Sethomepage_dofscommand (command, args) {var seth Omepageobj = InternetExplorer? Sethomepage:document.sethomepage; if (Command = = "setHomePage") {document.links[0].style.behavior = "url (#default #homepage)"; Document.links[0]. setHomePage (args); else if (Command = = "Addfavorite") {args = Args.split ("|"); window.external.AddFavorite (Args[0], args[1]);
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.