oh wow - thankyou very much

On 25 May 2007, at 14:27, Muzak wrote:

asfunction only allows one parameter to be passed to the invoked function.
You can split the argument using the delimiter (comma in your case).

simplified version for readability

'asfunction:itemOverlay,value1,value2,value3,value4'

itemOverlay() {
    var args:Array = arguments[0].split(",");
    var len:Number = args.length;
    for(var i=0; i<len; i++) {
        trace(args[i]);
    }
}

To make a clear destinction between the function and arguments, you could use a different delimiter, as in:

'asfunction:itemOverlay,value1|value2|value3|value4'

And use arguments[0].split("|") to get the values.

regards,
Muzak


----- Original Message -----
From: "Allandt Bik-Elliott (Receptacle)" <[EMAIL PROTECTED]>
To: "flashcoders" <flashcoders@chattyfig.figleaf.com>
Sent: Friday, May 25, 2007 3:01 PM
Subject: [Flashcoders] asfunction passing a Number as x,x ??


this is a strange one for asfunction

i'm constructing my <a> function call like this

productVariations += "<p><a href='asfunction:_parent.itemOverlay,"+product+","+i+"'>I'd like to view this</a></p>";

to pass 2 dynamic variables - product and i - to the itemOverlay function but if i run

function itemOverlay(product:Number, variation:Number) {
trace ("product: "+product+"   variation: "+variation);
}

i get a trace of

product: 0,0   variation: undefined

so the asfunction call is passing 0,0 to the first (Number) variable leaving no more arguements for the second one

what did i do wrong?

hope you can help
obie


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to