Problem in URL change in ActionScript

Problem in URL change in ActionScript

Page 1 of 1

1 Replies - 5449 Views - Last Post: 23 November 2005 - 01:37 AM

#1 deepathenappan  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-November 05

Problem in URL change in ActionScript

Post icon  Posted 23 November 2005 - 12:02 AM

Hello All,

I'm a newbie to flash. Dont know ABC's even. I was working on a PHP proj when the client gave me a flash file and asked to change the URL called for action. I have provided the actionscript snippet below...

function btnConfirmClick() {
    getVars = new LoadVars();
    sendVars = new LoadVars();
    
    getSession = new LoadVars();
    getSession.load("test.txt");
    
    sendVars.PHPSESSID = getSession.phpsessionid;
    
    sendVars.namestring = myNameIs_str;
    sendVars.imagearray = '';
    sendVars.dedication = dedication_str;
    
    for (var i=1; i<myNames_array.length; i++) {
        
        if (i>1) sendVars.imagearray += ",";
        
        for (var j=1; j<myNames_array[i].length; j++) {
            if (i>1 || j>1) sendVars.imagearray += ",";
            l_str = myNames_array[i][j].whichLetter.toLowerCase();
            o_str = myNames_array[i][j].whichOption;
            sendVars.imagearray += l_str + "_" + o_str + ".jpg";
        }
    }
    
    getVars.onload=function(scriptResponse) {
        
        // connector.php will send back string 'success' for variable scriptResponse if the
        // validation of the posted variables is successful.  otherwise, it will return an error code
        // that is to be handled by error.php.
        if (getVars.scriptResponse == "success") {
            getURL("javascript:launchCart('" + getVars.bookid + "', '" + myNameIs_str + "')");
            // then go home <or not>
            gotoAndPlay('Scene 1',1);
        } else getURL("http://mni.athilakshmiinc.com" + getVars.scriptResponse);
        
    }
    
    sendVars.sendAndLoad("http://mni.athilakshmiinc.com/connector.php", getVars, "POST");
}


In the above code, http://mni.athilakshmiinc.com is the URL i'm supposed to change to a diff URL..I modified but although connector.php always returns "success", javascript launchCart is not invoked..


Please help me.... :blink:

Is This A Good Question/Topic? 0
  • +

Replies To: Problem in URL change in ActionScript

#2 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Problem in URL change in ActionScript

Posted 23 November 2005 - 01:37 AM

You have all the Javascript scripts needed? And placed in appropriate folders?

Launching the .swf file by itself won't work... you have to view it in a browser, with the flash embeded in a html file.... in that HTML file you'd have functions (or linked to a javascript file).. flash then calls those javascript functions.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1