Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  
    Hi there,

    New to the forums. So excuse if this sounds a bit silly.
    Is there anyway of getting document.location as a variable and then adding it to the swf object embed code.

    Something like this:

    <SCRIPT LANGUAGE="JavaScript" type="text/javascript">
    function getsid() {

    var sid;
    sid = document.location.href;

    }
    </SCRIPT>

    <script type="text/javascript">
    var so = new SWFObject("shared_object.swf", "mymovie", "200", "350", "8", "#fff");
    so.addVariable("user_id", "getsid");
    so.write("flashcontent");
    </script>

    Any advice would be much appreached ;)

    Thanx
    Keith
    • CommentAuthorAran
    • CommentTimeApr 11th 2008
     
    Keith.

    You are currently setting your user_id variable value to the string "getsid". You want is to call your function getsid() which need to be modified to be:

    // the below returns the value of sid back what you run the function
    function getsid()
    {
    var sid = document.location.href;
    return sid;
    }


    then call the function in your swfobject code:

    so.addVariable("user_id", getsid" ());


    OR

    just set sid outside of a function within the head tag and then just call it directly in swfobject

    <head>
    ...
    <SCRIPT LANGUAGE="JavaScript" type="text/javascript">
    var sid = document.location.href;
    </SCRIPT>
    ..

    so.addVariable("user_id", sid);


    Cheers,
    Aran
  2.  
    Thanks man ! Perfect :)