Hello All,
I am using the following code to see the use of optional parameters.
[COLOR=Red]
crRhombus(109,150,0x333311,0x556431,14);
function crRhombus(w:uint=10,h:uint=20,lclr:uint=0x990000,fclr:uint=0xff0000,lwid:uint=2)
{
var objHeight:uint = h;
var objWidth:uint = w;
var myRhohmbus:Sprite = new Sprite();
addChild(myRhohmbus);
myRhohmbus.x = 100;
myRhohmbus.y = 50;
// red triangle, starting at point 0, 0
myRhohmbus.graphics.lineStyle(lwid, lclr, 1);
myRhohmbus.graphics.beginFill(fclr);
myRhohmbus.graphics.moveTo(objWidth/2, 0);
myRhohmbus.graphics.lineTo(objWidth, objHeight);
myRhohmbus.graphics.lineTo(objWidth/2, objHeight*2);
myRhohmbus.graphics.lineTo(0, objHeight);
myRhohmbus.graphics.lineTo(objWidth/2, 0);
}
[COLOR=Black]So in the first line I am calling the function passing some parameter values. If I am skipping first parameter or any in between, then the code is not working. But if I am keeping sequence from first parameter to any last parameter, its working fine.
So my question is can I skip any parameter value from first or in between while calling the function. Please suggest.
[/COLOR][/COLOR]