as3 externalInterface?

  • Started
  • Last post
  • 0 Responses
  • wwfc

    afternoon!
    does anyone know how i need to write this on click function to call up a javascript function in the main browser window?
    I want/need to use the externalinterface class, and call it somewhere in here:
    function p_click(me:MouseEvent)
    {
    var sp:Sprite = me.target as Sprite;
    //this is your array reference to the url, right?
    var s_no:Number = parseInt(sp.name.slice(8,10));

    var urlstring:String = "javascript:myLightWindow.activa...
    //Now, you need to include the url of the video in the string //in this way
    urlstring += "href:'"+url_list[s_no]+"', "
    ///tweak those parameters (i guess you can even remove them
    urlstring += "title:'Sometitle', "
    urlstring += "author:'author'"

    urlstring += "})"

    trace (urlstring)
    ////the output should be something like
    // "javascript:myLightWindow.activa... href:'YOUR URL', title:'Sometitle', author:'name'})"

    var req:URLRequest = new URLRequest(urlstring)
    /////and then finally go to the url:
    navigateToURL(req, url_target_list[s_no]);
    }

    i know i need to import it at the start, but how to implement it in there - should it replace one or all of the urlstring calls?

    anyone know what is the right way of doing this?
    ...please?