0

Ok i seem to be have alot of problems with this script,
first of all there must be an easier way to do something if a function doesnt trigger than having a variable but if this is the only way then it is not working for me. i first tried witha string and now a number and the checkif variable does not get detected properly (the else statement runs either way)

also it looks messy and inefficient to me with the if else statement is there a better way to do that part? if not can u help me to get it working?

function addPicMain(event:Event):void {
        var addTov:String = event.target.name
	var imgLoader:Loader = new Loader ();
	var checkif:Number = 1
	var imgRequest:URLRequest = new URLRequest("galImgs/pic" + addTov + ".png");
  	imgLoader.load(imgRequest);
	event.target.addChild(imgLoader);
	imgLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErr);
	function ioErr(event:Event){
		MovieClip(loaders_mc.getChildByName(addTov)).gotoAndStop(171);
		checkif++
	}
	if(checkif == 2){
		
	} else {
		event.target.removeChild(event.target.si_mc);
		MovieClip(loaders_mc.getChildByName(addTov)).removeMovieClip;
	}
	event.target.removeEventListener(Event.ENTER_FRAME, addPicMain)
}

any help is greatly appreciated, thank you in advance
plz help if there is something i didnt put or i am asking to much please just tell or ask me thanks

Edited by DJAyzed: didnt have function part included

2
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

I'm not able to look into this without the calling function, where you declared with what name like that? . Provide the full source

0
gb1_mc.addEventListener(Event.ENTER_FRAME, addPicMain)

thats the caller, sorry. There is also a caller for 8 other all named the same thing but the number goes up so it doesnt relly matter

Edited by DJAyzed: forgot code tags

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.