I have 2 SWFs. One Parent.swf and other is child.swf.
in the parent SWF I am loading child swf.
I am using a loader to load swf. My code is as follows :
----------------------------------------
stop();
var req:URLRequest = new URLRequest("stalla.swf");
var _loader = new Loader();
var stallaloader1:MovieClip=new MovieClip();
addChild(stallaloader1);
Object(this).stallaloader1.x=5000;
_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loader_complete);
_loader.load( req );
stallaloader1.addChild(_loader);
trace(stallaloader1.x);
//_loader.vipin="Ashwini n Meha";
function loader_complete(evt:Event):void {
//addChild(_loader);
var _loader:MovieClip = MovieClip(evt.target.content);
//addChild(_loader); //embedSWF
//stallaloader1.stallclick;
//_loader.stallclick;
//evt.currentTarget.x=1000;
// btn2.addEventListener(MouseEvent.CLICK,_loader.stallclick);
btn2.addEventListener(MouseEvent.CLICK, function() {videovariables(2)});
}
function videovariables(vid):void {
trace(_loader.vipin);
_loader.vipin="Overwrite with Ashwini"
trace(_loader.vipin);
}
These 3 line work well if called in loader_complete, BUT
If we put them in videovariables function, we get error :
ReferenceError: Error #1069: Property vipin not found on flash.display.Loader and there is no default value. at _3dstalls_fla::Symbol1_1/videovariables()[_3dstalls_fla.Symbol1_1::frame1:53] at Function/()[_3dstalls_fla.Symbol1_1::frame1:49]
What may be the reason? Please let me know.
Thanks