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.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErr);
	function ioErr(event:Event){
	if(checkif == 2){
	} else {
	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

Recommended Answers

All 4 Replies

Member Avatar for rajarajan2017

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

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

Nvm guys i figured it out myself lol

Member Avatar for rajarajan2017

Thats great! but you can share the thing you have done.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.