Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asfunction: passing two parameters 1

Status
Not open for further replies.

kentara

Programmer
Apr 13, 2005
38
0
0
US
Is it possible to pass two (or more) parameters using asfunction? The function I am using with asfunction requires that two variables are passed into it.

If it is possible, how do you format this syntactically? Here is what I've got:

Code:
infobox.htmlText = "<a href='asfunction:pathLinkTo,file1.swf,1'>File 1</a>";

function pathLinkTo(link,ID) {
	_global.pgID = ID;
	_global.fileLink = link;
}

Note that the parameters here that I am trying to pass into the pathLinkTo function using asfunction are "file1.swf" and "1" respectively.

The above code successfully passes the first parameter into the function, but not the second (which comes in as undefined).

What do you think?
 
function pathLinkTo(params) {
myVars = params.split(",");
_global.pgID = myVars[0];
_global.fileLink = myVars[1];
}

 
This works great -- Thanks to you both!! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top