Function does not return expected result

Everyone,

I set up a couple of functions to represent the flow of a future application; it initializes, and calls a function that will ready my movie. The readyMovie function calls fromThinAir to create a clip with a child.

I know variables are destroyed when the function is complete, but what happens to the return value?

Why does Flash create the clip and let it remain on the timeline, but nothing is in temp when traced? Isn’t that the entire reason for return? To use the results somewhere else?

If I’m using any of this incorrectly, someone please let me know about some search results to query for, because I’m not getting the information I need through searching…

Someone please help me understand these unexpected results, and thanks for your help:


import flash.filters.*;
import flash.display.*;
import flash.geom.*;
var SW:Number = Stage.width;
var SH:Number = Stage.height;
var temp:MovieClip;
//
function fromThinAir(container:String, shape:String) {
    trace(container);
    trace(shape);
    var temp:MovieClip = this.createEmptyMovieClip(container, this.getNextHighestDepth());
    var tempShape:MovieClip = temp.createEmptyMovieClip(shape, temp.getNextHighestDepth());
    return temp;
}
//
function readyMovie():Void {
    fromThinAir("container", "shape");
    trace(temp);
    //    trace("readyMovie START");
    //    trace("readyMovie END");
}
//
function init() {
    //    trace("init START");
    if (this.inited != undefined) {
        return;
    }
    this.inited = true;
    readyMovie();
    //    trace("init ENDED");
}
//
this.init();