all groups > flash actionscript > august 2005 >
You're in the

flash actionscript

group:

Please help with asfunction


Please help with asfunction iJustLoveFlash
8/26/2005 9:01:23 PM
flash actionscript:
I managed to create a text parser what makes all URLs in text a link
automaticlly. I would like to pass on 2 vars not 1, but then it does not work.
I was also unsuccessful creating an custom function what did not work

custom_getURL($url){
getURL($url, "_blank");
}

How to pass on 2 second var? How it would work :(
<a href=\"asfunction:getURL,"+$url+"\">"+$url+"</a>.
Re: Please help with asfunction abeall
8/26/2005 10:08:10 PM
Why the dollar sign? This isn't PHP :-)

Did you try passing an array[] or object{} for the argument?

custom_getURL(arg){
getUrl(arg.url, arg.window);
}

<a href=\"asfunction:getURL,"+{url:url,window:window}+"\">"+url+"</a>.
Re: Please help with asfunction abeall
8/26/2005 10:17:33 PM
I tried it(and fixed all the errors in the above psuedo script), but then I had
a brilliant idea, and I read the help files ;)

"parameter A string that is passed to the function named in the function
parameter."

It has to be a string. That leaves your best option to pass a comma delimated
string, and split it in your function:

function custom_getURL(arg){
arg = arg.split(",");
getURL(arg[0],arg[1]);
trace(arg[2]);
}
url = "http://abeall.com";
window = "_blank";
comment = "My site needs serious updating."
myTextField.htmlText = "<a
href='asfunction:custom_getURL,"+url+","+window+","+comment+"'>"+url+"</a>"
Re: Please help with asfunction iJustLoveFlash
8/27/2005 12:34:20 AM
custom_getURL(arg){
getUrl(arg.url, arg.window);
}

<a href=\"asfunction:getURL,"+{url:url,window:window}+"\">"+url+"</a>.


If this works i will give you 1000 dollars :) It does not work, no need to get
all exited :) Firstoffall, you are galling getURL net custom_getURL. And in
the custom_getURL call i fail. Dunno why :(
Re: Please help with asfunction abeall
8/27/2005 12:57:32 AM
AddThis Social Bookmark Button