# (AS3)value from one function to another in same class

**URL:** https://forum.kirupa.com/t/as3-value-from-one-function-to-another-in-same-class/308931
**Category:** programming
**Created:** [May 3, 2010, 4:55pm UTC](https://forum.kirupa.com/t/as3-value-from-one-function-to-another-in-same-class/308931 "2010-05-03T16:55:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![guitood](https://avatars.discourse-cdn.com/v4/letter/g/ba9def/32.png) [@guitood](https://forum.kirupa.com/u/guitood)
#### Post date: [May 3, 2010, 4:55pm UTC](https://forum.kirupa.com/t/as3-value-from-one-function-to-another-in-same-class/308931/1 "2010-05-03T16:55:14Z")

</div>

Hello, how do I get the value M (received from another class through the setter. I know I get it because the trace gives me the value) to the MovieLoader function. The answers probably in front of my nose, but I just can’t see it.

package {

```
import flash.display.MovieClip;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.ProgressEvent;

public class MovieLoader extends MovieClip {

    public function MovieLoader() {
        var M:String;
        var imageReq:URLRequest=new URLRequest(M+".swf");
        var imageLoader:Loader = new Loader();
        imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
        imageLoader.load(imageReq);
    }

    public static function set scenePlay(M:String):void {
        trace(M);
    }

    public function loadHandler(event:Event) {
        var scene:MovieClip=event.target.content;
        addChild(scene);
        scene.stop();
    }
}

```

}

Thanks for any help!!!
