A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Experts can you help?

  1. #1
    Member
    Join Date
    Apr 2003
    Location
    Manchester UK
    Posts
    32

    Experts can you help?

    i would like to know how i can put a link or button into my flash movie that when clicked on , sets my site as the users home page, if anyone knows i would be very grateful.

    Cheers
    Acestu

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    You can do this,

    first add this javascript function in between the opening and closing head tags of your page,

    Code:
    <script type="text/javascript">
    function setHome() {
        if (document.getElementById && document.all) {
            var obj = document.getElementById('home');
            obj.style.behavior='url(#default#homepage)';
            obj.setHomePage(location.href);
        }
    }
    </script>
    next somewhere in the body of your page add a link like this,

    <a href="#" id="home"></a>

    since there is no link text, this won't be visible to the user but it can be used by the javascript to create the object it needs.

    finally in your movie add a button with the script.

    code:

    on (press) {
    getURL("javascript:setHome();");
    }



    hope this helps

    edit - there shouldn't be a space in the word javascript, it gets added by the board.
    Last edited by catbert303; 04-30-2003 at 06:02 PM.

  3. #3
    Member
    Join Date
    Apr 2003
    Location
    Manchester UK
    Posts
    32

    Thanks!!

    Thanks for the info Catbert303 I will give this a try, just wondering if you know if it works on all browsers?.

    Cheers Acestu

  4. #4
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    no, its only internet explorer (probably only on windows too, but I don't have a mac to test on).

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