-
I am making a site for a friend in flash, and i have to indlude some buttons to :
Set as homepage
Add to favorites
This isnt a problem in html or javascript, but i cant seem to get anything work, as all the code works with href links and the 'On Click' function!!
Does anyone have anything similar on their flash site or know how to perform these things in callable JS functions??
Any help welcome .
Cheers!!
-
Flashkit Jedi
Hi,
I'll assume that you know how to write JS & html, so this is what you do:
Write your JS functions into the head of the html document.
Add the following AS to a button or frame:
getURL("javascript:functionName()");
Thats it (assuming that the function is called functionName) and if it isn't, just change the name in the AS.
XFM
-
Heres a bit my DW extension throws in
for others using Dreamweaver, here's some Java
<script language="JavaScript">
<!--
if(document.all){
document.write("<P ALIGN='CENTER'><A HREF='#' onclick='window.external.AddFavorite(top.location. href, top.document.title);return false'>Add my page to your Favorites</A></P>")
}
//-->
</script>
-
Hey, thanks for all your help......the homepage code didnt work in IE6, but the Crockatt, thank for the Favourites code!!
I found the solution :
I knew how to call a function, but the code for setting the homepage seemed only to work 'onClick' (used in a html link) and would not fire if made into a seperate method.
For future reference (after much homework) anyone wanting to set a home page from flash thru JavaScript use this:
In JS:
function setHomePage(){
document.all[0].style.behavior="url(#default#homepage)";
document.all[0].setHomePage('your URL');
}
(uses 'document.all[0]' rather than '.this')
In flash:
on(release){
getURL("JavaScript:setHomePage()")
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|