dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Question for JavaScript Guru - So far no luck

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    72
    I don't do web development for a living so please excuse my ignorance.

    The following code doesn't work when using IE6 and a url redirect service but does with IE5.

    Flash lets you call javascript for buttons. The on release is after the user clicks on a button.
    My goal is to have a favorite added upon clicking the add favorite button I've created in flash. The SWF is the file flash creates which you can view directly through IE or call it from within an html document.

    on (release) {
    getURL ("javascript:window.external.AddFavorite('URL OF PAGE','NAME OF SITE');");
    }

    It works when going through IE5 but not IE6 -- any guesses? I know that there are some work arounds in javascript for redirect services but unfortunately, I don't program in javascript at all.



  2. #2
    they call me the_jump... le_saut's Avatar
    Join Date
    Mar 2001
    Posts
    536
    This is the way I do it - works in IE6. See my site to check it out.

    Code:
        function doBookmark(url,pagetitle)
        {
                //code for IE4+ on win32
                if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion >= "4.0" && navigator.platform == "Win32")
                {
                window.external.AddFavorite(url, pagetitle);
                }
                //This code posts text if not
                else
                {
                window.alert('Hit Ctrl-D (Command-D on a Mac) to bookmark this page. You can edit the bookmark by entering this URL - ' +  url + ' - and the following title \"' + pagetitle + '\"');
                }
        }
    in Flash do this
    Code:
    getUrl("javascript:doBookmark('http://www.webqs.com','webQS.com - web development')");
    //or in a text link code this
    <a href="javascript:doBookmark('http://www.webqs.com','webQS.com - web development')">Bookmark</a>
    This should work

    Cheers
    James

  3. #3
    Member
    Join Date
    Jul 2002
    Posts
    72
    Thanks - my website will only allow IE5 and 6 clients through. Sorry if this seems obvious but I don't know javascript or html at all. Is the first part for my html and the second part for my button in flash?

    I checked out your website - are you using a redirect service or is that your real http address. My code works as long as I don't use the http redirect service for my web page url

    This is what I have for responses from people so far.

    Here is what I have in responses although so far I haven't made any progress -

    IE 5 contained JavaScript usage but IE 6 does not and that is why you are having a problem. To accomplish what you want, type the following in the IE 6 URL bar and then click "enter". This will install the necessary code on your PC and you will then be able to do what you want.
    MSJava86 CD24D109B33421DB6728FBDC80C9F572EB7A3865
    If you continue to have problems, check the XP General NG for any items reading either "Virtual Machine", or "Java". You will find a shorter link for what you need. Because MS didn't include the code in IE 6 this problem has been encountered by many people, it is not unique to you but the solution is there
    Microsoft Virtual Machine Download
    http://www.download.windowsupdate.co...C9F572EB7A3865


    I've gotton this information which may help --

    http://msdn.microsoft.com/library/de...g_security.asp

    Seems to contain the clue to what the issue is but is there a way to set the document.domain property in my html so that it can behave as if it is on that domain (technically it could be said that it is) so that any references within my documents come from the redirected domain?


    [Edited by jim2002 on 08-25-2002 at 03:46 PM]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center