Trouble passing variables from js to swf from another page

Hi,

I’m using ExternalInterface to pass javascript variables to my swf file, when the javascript and the swf are in the same html page, everything works perfectly. The trouble comes when I try to send this variable through the URL to control a swf located in another page.

Here’s my as3 code :

if(ExternalInterface.available)
{
    try
    {
        ExternalInterface.addCallback("next", goNext);
        
    }
    catch(e:Error){}
}

function goNext(value:String)
{
    
    //traceTextField.text=value;
    gotoAndPlay(value);
}

and in the page 1 (from which I want to send the variable) :
an html link :

the page2 is the parameter I want to send to the swf of the second page so this one goes directly to the “page2” label in the timeline.

In my “receiver” page2 here’s the js code that allows me to catch the parameter from the URL:

<script>

function getParams() 
{

    var idx = document.URL.indexOf('?');    
    var pairs;    
    if (idx != -1) 
    {
        
        var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
        pairs=pairs.toString();    
        alert(pairs);
        gotoNext(pairs);

    }

return pairs;

}

pairs = getParams();


function thisMovie(movieName)
{
     if (navigator.appName.indexOf("Microsoft") != -1) 
     {
         return window[movieName];
     } 
     else 
     {
         return document[movieName];
     }
}
function gotoNext(value) 
{
    thisMovie("myFlash").next(value);
}
function gotoPrev(value) {
    thisMovie("myFlash").previous(value);
}
</script>

the ‘page2’ parameter is caught (I’ve checked with the alert),
the problem is that it isn’t sent to the swf, that’s where I’m something wrong…

Thanks in advance for your help