--- In [email protected], "dennis" <den...@...> wrote:
>
> Some times, the one result of a function is not enough, cay we use the
> arguments to get back values from them?
> 
>  
> 
> internal function getXY(x:int,y:int):void{
> 
>   x=10;y=20;
> 
> }
> 
>  
> 
> internal function test():void{
> 
>   var x:int; var y:int;
> 
>   getXY(x,y);
> 
>   trace("x: "+x.toString()+" y: "+y.toString());  // here I get "x: 0 y: 0",
> I want to get "x: 10 y: 20"
> 
> }
> 
>  
> 
> For instance, in c the getXY should be like this:
> 
>  
> 
> internal function getXY(int* x, int* y):void{
> 
>   x=10;y=20;
> 
> }
> 

Try:

private function getXY(x:int, y:int):Object {
    return {x:10, y:20);
}

private function test():void {
    var obj:Object = getXY(0, 0);
    trace('x: ' + obj.x + ' y: ' + obj.y);
]

HTH;

Amy

Reply via email to