Link to home
Start Free TrialLog in
Avatar of designaire
designaireFlag for United States of America

asked on

as3 can you import too many files in flash?

I was creating a flash file that imports swf files by clicking the next button, then it uploads and imports the next swf file. I get to about 50th file and it gives me an error message. Is there a limit to how many swf files it can load? I really seems to error out on the same time and doesn't seem to be an error in the code.
Avatar of deepanjandas
deepanjandas
Flag of India image

Kindly check with server session time.
Also check with the file size, as though there is no specific data limit theoritically, but I do remember reading a blog which says about a size limit, though that is very high.

So also check with the 50th file whether it is a good one.

By the way what error are you getting, kindly share the fault message details.


Warm Regards
Deepanjan Das
http://deepanjandas.wordpress.com
Avatar of designaire

ASKER

I think it might be the sound. I was just testing some mocked up flash files and they all had running sound and they were all playing at once when I loaded it. The file was loading but just giving me an error message. I'm going to stop the sound on all the files and see if that works.

TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at xxx_10_pg_4_fla::MainTimeline/frame1()
So it suggests that there is a null value for a variable in frame 1. check for that.

Warm Regards
Deepanjan Das
http://deepanjandas.wordpress.com
I think there was too much sound playing at the same time.

Now I'm having a problem with the back button. It appears that there are just too many arrays or something. It starts to go to the wrong frame after the 7th section. The code and the files are fine. Maybe there are too many arrays. I have a feeling flash is just not made to do something like this. All it does is go to the next frame with the next button and back a frame with the back button. There are 25 sections and about 5 frames per section. There needs to be sections and not just continuous files.
var Section1:String;
var clips1:Array = new Array();
for (var a:int = 0; a < 7; ++a)
{
	
  Section1 = "images/test1_" + a.toString() + ".swf ";
  clips1.push(Section1);
}

var Section2:String;
var clips2:Array = new Array();
for (var b:int = 0; b < 6; ++b)
{
  Section2 = "images/test2_" + b.toString() + ".swf ";
  clips2.push(Section2);
}

var Section3:String;
var clips3:Array = new Array();
for (var c:int = 0; c < 6; ++c)
{
  Section3 = "images/test3_" + c.toString() + ".swf ";
  clips3.push(Section3);
}


var Section4:String;
var clips4:Array = new Array();
for (var d:int = 0; d < 6; ++d)
{
  Section4 = "images/xxx_04_pg_" + d.toString() + ".swf ";
  clips4.push(Section4);
}

var Section5:String;
var clips5:Array = new Array();
for (var e:int = 0; e < 6; ++e)
{
  Section5 = "images/xxx_05_pg_" + e.toString() + ".swf ";
  clips5.push(Section5);
}

var Section6:String;
var clips6:Array = new Array();
for (var f:int = 0; f < 6; ++f)
{
  Section6 = "images/xxx_06_pg_" + f.toString() + ".swf ";
  clips6.push(Section6);
}

var Section7:String;
var clips7:Array = new Array();
for (var g:int = 0; g < 6; ++g)
{
  Section7 = "images/xxx_07_pg_" + g.toString() + ".swf ";
  clips7.push(Section7);
}

var Section8:String;
var clips8:Array = new Array();
for (var h:int = 0; h < 6; ++h)
{
  Section8 = "images/xxx_08_pg_" + h.toString() + ".swf ";
  clips8.push(Section8);
}

var Section9:String;
var clips9:Array = new Array();
for (var i:int = 0; i < 6; ++i)
{
  Section9 = "images/xxx_09_pg_" + i.toString() + ".swf ";
  clips9.push(Section9);
}

var Section10:String;
var clips10:Array = new Array();
for (var j:int = 0; j < 6; ++j)
{
  Section10 = "images/xxx_10_pg_" + j.toString() + ".swf ";
  clips10.push(Section10);
}

var Section11:String;
var clips11:Array = new Array();
for (var k:int = 0; k < 6; ++k)
{
  Section11 = "images/xxx_11_pg_" + k.toString() + ".swf ";
  clips11.push(Section11);
}

var Section12:String;
var clips12:Array = new Array();
for (var l:int = 0; l < 6; ++l)
{
  Section12 = "images/xxx_12_pg_" + l.toString() + ".swf ";
  clips12.push(Section12);
}

var Section13:String;
var clips13:Array = new Array();
for (var m:int = 0; m < 6; ++m)
{
  Section13 = "images/xxx_13_pg_" + m.toString() + ".swf ";
  clips13.push(Section13);
}

var Section14:String;
var clips14:Array = new Array();
for (var n:int = 0; n < 6; ++n)
{
  Section14 = "images/xxx_14_pg_" + n.toString() + ".swf ";
  clips14.push(Section14);
}

var Section15:String;
var clips15:Array = new Array();
for (var o:int = 0; o < 6; ++o)
{
  Section15 = "images/xxx_15_pg_" + o.toString() + ".swf ";
  clips15.push(Section15);
}

var Section16:String;
var clips16:Array = new Array();
for (var p:int = 0; p < 6; ++p)
{
  Section16 = "images/xxx_16_pg_" + p.toString() + ".swf ";
  clips16.push(Section16);
}

var Section17:String;
var clips17:Array = new Array();
for (var q:int = 0; q < 6; ++q)
{
  Section17 = "images/xxx_17_pg_" + q.toString() + ".swf ";
  clips17.push(Section17);
}

var Section18:String;
var clips18:Array = new Array();
for (var r:int = 0; r < 6; ++r)
{
  Section18 = "images/xxx_18_pg_" + r.toString() + ".swf ";
  clips18.push(Section18);
}

var Section19:String;
var clips19:Array = new Array();
for (var s:int = 0; s < 6; ++s)
{
  Section19 = "images/xxx_19_pg_" + s.toString() + ".swf ";
  clips19.push(Section19);
}

var Section20:String;
var clips20:Array = new Array();
for (var t:int = 0; t < 6; ++t)
{
  Section20 = "images/xxx_20_pg_" + t.toString() + ".swf ";
  clips20.push(Section20);
}

var Section21:String;
var clips21:Array = new Array();
for (var u:int = 0; u < 6; ++u)
{
  Section21 = "images/xxx_21_pg_" + u.toString() + ".swf ";
  clips21.push(Section21);
}

var Section22:String;
var clips22:Array = new Array();
for (var v:int = 0; v < 6; ++v)
{
  Section22 = "images/xxx_22_pg_" + v.toString() + ".swf ";
  clips22.push(Section22);
}

var Section23:String;
var clips23:Array = new Array();
for (var w:int = 0; w < 6; ++w)
{
  Section23 = "images/xxx_23_pg_" + w.toString() + ".swf ";
  clips23.push(Section23);
}

var Section24:String;
var clips24:Array = new Array();
for (var ab:int = 0; ab < 6; ++ab)
{
  Section24 = "images/xxx_24_pg_" + ab.toString() + ".swf ";
  clips24.push(Section24);
}

var Section25:String;
var clips25:Array = new Array();
for (var cd:int = 0; cd < 6; ++cd)
{
  Section25 = "images/xxx_25_pg_" + cd.toString() + ".swf ";
  clips25.push(Section25);
}






var clipsone:Array = [ "images/test1_0.swf"];

var index1:int = 0, index2:int=0, index3:int=0, index4:int=0, index5:int=0, index6:int=0, index7:int=0;
var index8:int = 0, index9:int=0, index10:int=0, index11:int=0, index12:int=0, index13:int=0, index14:int=0;
var index15:int = 0, index16:int=0, index17:int=0, index18:int=0, index19:int=0, index20:int=0, index21:int=0;
var index22:int = 0, index23:int=0, index24:int=0, index25:int=0;

var thisLoader:Loader = new Loader(); 
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);

var thisMC:MovieClip = new MovieClip();
addChildAt(thisMC , 1);


function nextClips(arr:Array, index:int):void{
	thisLoader.load(new URLRequest(arr[index]));
}

function oneClip1():void {
	thisLoader.load(new URLRequest(clipsone[0]));
}
/*

*/




function doneLoading(e:Event):void {
	removeChild(thisMC);
	thisMC = MovieClip(thisLoader.content);
	thisLoader.unload();
	addChildAt(thisMC, 1);
	thisMC.play();
}


	oneClip1();
	of.alpha=0;


function playNext(e:MouseEvent):void {
	
	if (index1 < clips1.length-1 )
	
	{
	index1 = (index1 + 1);
	nextClips(clips1,index1);
	counter.text=String(index1);
	total.text=String(clips1.length-1)
	of.alpha=100;
	
	}
	else if (index1 == clips1.length-1 && index2< clips2.length-1)
	{			
		index2 = (index2 + 1);
		nextClips(clips2,index2);
		counter.text=String(index2);
		total.text=String(clips2.length-1)
		//of.alpha=100;
			
	}
	else if (index2== clips2.length -1 && index3< clips3.length-1)
	{
		
	index3 = (index3 + 1);
	nextClips(clips3,index3);
	counter.text=String(index3);
	total.text=String(clips3.length-1)
	//of.alpha=100;
		}

	else if (index3== clips3.length -1 && index4< clips4.length-1)
	{
		
	index4 = (index4 + 1);
	nextClips(clips4,index4);
	counter.text=String(index4);
	total.text=String(clips4.length-1)
	//of.alpha=100;
		}

		else if (index4== clips4.length -1 && index5< clips5.length-1)
	{
		
	index5 = (index5 + 1);
	nextClips(clips5,index5);
	counter.text=String(index5);
	total.text=String(clips5.length-1)
	//of.alpha=100;
		}
	else if (index5== clips5.length -1 && index6< clips6.length-1)
	{
		
	index6 = (index6 + 1);
	nextClips(clips6,index6);
	counter.text=String(index6);
	total.text=String(clips6.length-1)
	//of.alpha=100;
		}
		
	else if (index6== clips6.length -1 && index7< clips7.length-1)
	{
		
	index7 = (index7 + 1);
	nextClips(clips7,index7);
	counter.text=String(index7);
	total.text=String(clips7.length-1)
	//of.alpha=100;
	trace(index7);
		}
		
	else if (index7== clips7.length -1 && index8< clips8.length-1)
	{
		
	index8 = (index8 + 1);
	nextClips(clips8,index8);
	counter.text=String(index8);
	total.text=String(clips8.length-1)
	//of.alpha=100;
		}
		
	else if (index8== clips8.length -1 && index9< clips9.length-1)
	{
		
	index9 = (index9 + 1);
	nextClips(clips9,index9);
	counter.text=String(index9);
	total.text=String(clips9.length-1)
	//of.alpha=100;
		}
	
	else if (index9== clips9.length -1 && index10< clips10.length-1)
	{
		
	index10 = (index10 + 1);
	nextClips(clips10,index10);
	counter.text=String(index10);
	total.text=String(clips10.length-1)
	//of.alpha=100;
		}
	
	else if (index10== clips10.length -1 && index11< clips11.length-1)
	{
		
	index11 = (index11 + 1);
	nextClips(clips11,index11);
	counter.text=String(index11);
	total.text=String(clips11.length-1)
	//of.alpha=100;
		}
	
	else if (index11== clips11.length -1 && index12< clips12.length-1)
	{
		
	index12 = (index12 + 1);
	nextClips(clips12,index12);
	counter.text=String(index12);
	total.text=String(clips12.length-1)
	//of.alpha=100;
		}
		
	else if (index12== clips12.length -1 && index13< clips13.length-1)
	{
		
	index13 = (index13 + 1);
	nextClips(clips13,index13);
	counter.text=String(index13);
	total.text=String(clips13.length-1)
	//of.alpha=100;
		}
		
	else if (index13== clips13.length -1 && index14< clips14.length-1)
	{
		
	index14 = (index14 + 1);
	nextClips(clips14,index14);
	counter.text=String(index14);
	total.text=String(clips14.length-1)
	//of.alpha=100;
		}
	
	
	
		else if (index14== clips14.length -1 && index15< clips15.length-1)
	{
		
	index15 = (index15 + 1);
	nextClips(clips15,index15);
	counter.text=String(index15);
	total.text=String(clips15.length-1)
	//of.alpha=100;
		}
	
			else if (index15== clips15.length -1 && index16< clips16.length-1)
	{
		
	index16 = (index16 + 1);
	nextClips(clips16,index16);
	counter.text=String(index16);
	total.text=String(clips16.length-1)
	//of.alpha=100;
		}
	
			else if (index16== clips16.length -1 && index17< clips17.length-1)
	{
		
	index17 = (index17 + 1);
	nextClips(clips17,index17);
	counter.text=String(index17);
	total.text=String(clips17.length-1)
	//of.alpha=100;
		}
		
		
			else if (index17== clips17.length -1 && index18< clips18.length-1)
	{
		
	index18 = (index18 + 1);
	nextClips(clips18,index18);
	counter.text=String(index18);
	total.text=String(clips18.length-1)
	//of.alpha=100;
		}
		
		
				else if (index18== clips18.length -1 && index19< clips19.length-1)
	{
		
	index19 = (index19 + 1);
	nextClips(clips19,index19);
	counter.text=String(index19);
	total.text=String(clips19.length-1)
	//of.alpha=100;
		}
		
				else if (index19== clips19.length -1 && index20< clips20.length-1)
	{
		
	index20 = (index20 + 1);
	nextClips(clips20,index20);
	counter.text=String(index20);
	total.text=String(clips20.length-1)
	//of.alpha=100;
		}
		
		
				else if (index20== clips20.length -1 && index21< clips21.length-1)
	{
		
	index21 = (index21 + 1);
	nextClips(clips21,index21);
	counter.text=String(index21);
	total.text=String(clips21.length-1)
	//of.alpha=100;
		}
		
				else if (index21== clips21.length -1 && index22< clips22.length-1)
	{
		
	index22 = (index22 + 1);
	nextClips(clips22,index22);
	counter.text=String(index22);
	total.text=String(clips22.length-1)
	//of.alpha=100;
		}
	
			else if (index22== clips22.length -1 && index23< clips23.length-1)
	{
		
	index23 = (index23 + 1);
	nextClips(clips23,index23);
	counter.text=String(index23);
	total.text=String(clips23.length-1)
	//of.alpha=100;
		}
	
			else if (index23== clips23.length -1 && index24< clips24.length-1)
	{
		
	index24 = (index24 + 1);
	nextClips(clips24,index24);
	counter.text=String(index24);
	total.text=String(clips24.length-1)
	//of.alpha=100;
		}
	
			else if (index24== clips24.length -1 && index25< clips25.length-1)
	{
		
	index25 = (index25 + 1);
	nextClips(clips25,index25);
	counter.text=String(index25);
	total.text=String(clips25.length-1)
	//of.alpha=100;
		}
	
		else
		{
		removeChild(thisMC);
		gotoAndPlay(25);
		}
}

function playBack(e:MouseEvent):void {
	
			if (index7)
	
	{   
		index7 = (index7 -1);
		nextClips(clips7,index7);
		counter.text=String(index7);
		total.text=String(clips7.length-1)
		//of.alpha=100;
		trace(index7);
		if (index7 == 0)
		{
		nextClips(clips6,index6);
		counter.text=String(index6);
		total.text=String(clips6.length-1)
		//of.alpha=100;
		}
	}
		
		if (index6)
	
	{   
		index6 = (index6 -1);
		nextClips(clips6,index6);
		counter.text=String(index6);
		total.text=String(clips6.length-1)
		//of.alpha=100;
		
		if (index6 == 0)
		{
		nextClips(clips5,index5);
		counter.text=String(index5);
		total.text=String(clips5.length-1)
		//of.alpha=100;
		}
	}
	
	
		else if (index5)
	
	{   
		index5 = (index5 -1);
		nextClips(clips5,index5);
		counter.text=String(index5);
		total.text=String(clips5.length-1)
		of.alpha=100;
		
		if (index5 == 0)
		{
		nextClips(clips4,index4);
		counter.text=String(index4);
		total.text=String(clips4.length-1)
		//of.alpha=100;
		}
	}
	
	else if (index4)
	
	{   
		index4 = (index4 -1);
		nextClips(clips4,index4);
		counter.text=String(index4);
		total.text=String(clips4.length-1)
		of.alpha=100;
		
		if (index4 == 0)
		{
		nextClips(clips3,index3);
		counter.text=String(index3);
		total.text=String(clips3.length-1)
		of.alpha=100;
		}
	}
	
	else if(index3)
	
	{   
		index3 = (index3 -1);
		nextClips(clips3,index3);
		counter.text=String(index3);
		total.text=String(clips3.length-1)
		of.alpha=100;
		
		if (index3 == 0)
		{
		nextClips(clips2,index2);
		counter.text=String(index2);
		total.text=String(clips2.length-1)
		//of.alpha=100;
		}
	}
		else if (index2)
	{   
		//trace(index2);
		index2 = (index2 -1);
		nextClips(clips2,index2);
		counter.text=String(index2);
		total.text=String(clips2.length-1);
		//of.alpha=100;
		
		if (index2 == 0)
		{
			nextClips(clips1,index1);
			counter.text=String(index1);
			total.text=String(clips1.length-1);
			//of.alpha=100;
			}	
	}
	
	else if (index1 > 1)
	{
		index1 = (index1 -1);
		nextClips(clips1,index1);
		counter.text=String(index1);
		total.text=String(clips1.length-1);
		//of.alpha=100;
	}
	
	else 
	{
		oneClip1();
	}
}

nextbtn.addEventListener(MouseEvent.CLICK, playNext);
backbtn.addEventListener(MouseEvent.CLICK, playBack);

Open in new window

Just found the next error also. Maybe I should close this out for now.
Can you share the fla,
It is hard to track the code from here as it is a long one.

Warm Regards
Deepanjan Das
http://deepanjandas.wordpress.com
I'll finish it, upload it to a server and send the link because there are many files that are imported. Then I'll upload the file here. Can't do it until Monday or Tuesday. Thanks
Here's the file. There are 5 sections with about 5 frames in each. I think the first one has 6. Everything thing is working but when you get to the end the back button goes to frame 4 instead of 5. All the other ones work but it seems like they shouldn't be working either. Not sure how it is working.

I do have a 0 swf that is never called. Maybe I should put another blank frame at the end.
Can't seem to upload the file...This is what it looks like.


http://www.designaire.com/IMI/test.htm
Here's the code...
mport flash.display.MovieClip;
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.MouseEvent;
import flash.text.TextField;

stop();

var loader:Loader=new Loader();
var defaultSWF:URLRequest= new URLRequest("bottom.swf");
loader.load(defaultSWF);
addChild(loader);
setChildIndex(loader, 0);

var Section1:String;
var clips1:Array = new Array();
for (var a:int = 0; a < 7; ++a)
{
	
  Section1 = "images/test1_" + a.toString() + ".swf ";
  clips1.push(Section1);
}

var Section2:String;
var clips2:Array = new Array();
for (var b:int = 0; b < 6; ++b)
{
  Section2 = "images/test2_" + b.toString() + ".swf ";
  clips2.push(Section2);
}

var Section3:String;
var clips3:Array = new Array();
for (var c:int = 0; c < 6; ++c)
{
  Section3 = "images/test3_" + c.toString() + ".swf ";
  clips3.push(Section3);
}


var Section4:String;
var clips4:Array = new Array();
for (var d:int = 0; d < 6; ++d)
{
  Section4 = "images/xxx_04_pg_" + d.toString() + ".swf ";
  clips4.push(Section4);
}

var Section5:String;
var clips5:Array = new Array();
for (var e:int = 0; e < 6; ++e)
{
  Section5 = "images/xxx_05_pg_" + e.toString() + ".swf ";
  clips5.push(Section5);
}


var clipsone:Array = [ "images/test1_0.swf"];


var clipsend:Array = [ "images/end_0.swf"];

var index1:int = 0, index2:int=0, index3:int=0, index4:int=0, index5:int=0, index6:int=0, index7:int=0;
var index8:int = 0, index9:int=0, index10:int=0, index11:int=0, index12:int=0, index13:int=0, index14:int=0;
var index15:int = 0, index16:int=0, index17:int=0, index18:int=0, index19:int=0, index20:int=0, index21:int=0;
var index22:int = 0, index23:int=0, index24:int=0, index25:int=0, index26:int=0;

var thisLoader:Loader = new Loader(); 
thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);

var thisMC:MovieClip = new MovieClip();
addChildAt(thisMC , 1);


function nextClips(arr:Array, index:int):void{
	thisLoader.load(new URLRequest(arr[index]));
}

function oneClip1():void {
	thisLoader.load(new URLRequest(clipsone[0]));
}


function endClip():void {
	thisLoader.load(new URLRequest(clipsend[index6]));
}
/*

*/

function doneLoading(e:Event):void {
	removeChild(thisMC);
	thisMC = MovieClip(thisLoader.content);
	thisLoader.unload();
	addChildAt(thisMC, 1);
	thisMC.play();
}
	oneClip1();
	of.alpha=0;
	this.removeChild(backbtn);
	this.removeChild(counter);
	this.removeChild(total);
	
function playNext(e:MouseEvent):void {
	
	if (index1 < clips1.length-1 )
	
	{
	this.addChild(backbtn);
	this.addChild(counter);
	this.addChild(total);

	index1 = (index1 + 1);
	nextClips(clips1,index1);
	counter.text=String(index1);
	total.text=String(clips1.length-1)
	of.alpha=100;
	
	}
	else if (index1 == clips1.length-1 && index2< clips2.length-1)
	{			
		index2 = (index2 + 1);
		nextClips(clips2,index2);
		counter.text=String(index2);
		total.text=String(clips2.length-1)
		//of.alpha=100;
			
	}
	else if (index2== clips2.length -1 && index3< clips3.length-1)
	{
		
	index3 = (index3 + 1);
	nextClips(clips3,index3);
	counter.text=String(index3);
	total.text=String(clips3.length-1)
	//of.alpha=100;
		}

	else if (index3== clips3.length -1 && index4< clips4.length-1)
	{
		
	index4 = (index4 + 1);
	nextClips(clips4,index4);
	counter.text=String(index4);
	total.text=String(clips4.length-1)
	//of.alpha=100;
	}

	else if (index4== clips4.length -1 && index5< clips5.length-1)
	{
		
	index5 = (index5 + 1);
	nextClips(clips5,index5);
	counter.text=String(index5);
	total.text=String(clips5.length-1)
	//of.alpha=100;
	}

	
	
	else if (index5== clips5.length -1)
		{
	of.alpha=0;
		removeChild(nextbtn);
		this.removeChild(counter);
		this.removeChild(total);
			endClip();
		}
}




nextbtn.addEventListener(MouseEvent.CLICK, playNext);


//loading into clip

course.dropdown_mc.b1.myText.text="Section 1";
course.dropdown_mc.b2.myText.text="Section 2";
course.dropdown_mc.b3.myText.text="Section 3";
course.dropdown_mc.b4.myText.text="Section 4";
course.dropdown_mc.b5.myText.text="Section 5";

course.dropdown_mc.addEventListener(MouseEvent.CLICK, clickHandler);

function clickHandler(event:MouseEvent):void {
if(event.target == course.dropdown_mc.b1) {
trace(index1);
		index1=1;
		nextClips(clips1,index1);
		
		for (var i1:int = 2; i1 <25; ++i1)
		{
      		this["index"+i1]= 0;
		}
		counter.text=String(index1);
		total.text=String(clips1.length-1);
		this.addChild(backbtn);
		this.addChild(counter);
		this.addChild(total);
		of.alpha=100;
}
	
//	
	
if(event.target == course.dropdown_mc.b2) {

		index1=clips1.length-1;
		index2=1;
		trace(index2);
		nextClips(clips2,index2);
		
		for (var i2:int = 3; i2 <25; ++i2)
		{
        this["index"+i2]= 0;
		}
		counter.text=String(index2);
		total.text=String(clips2.length-1);
		this.addChild(backbtn);
		this.addChild(counter);
		this.addChild(total);
		of.alpha=100;
}
	
//

if(event.target == course.dropdown_mc.b3) {

		index1=clips1.length-1;
		index2=clips2.length-1;
		index3=1;
		nextClips(clips3,index3);
		for (var i3:int = 4; i3 <25; ++i3)
		{
        this["index"+i3]= 0;
		}
		counter.text=String(index3);
		total.text=String(clips3.length-1);
		this.addChild(backbtn);
		this.addChild(counter);
		this.addChild(total);
		of.alpha=100;
	}
	
if(event.target == course.dropdown_mc.b4) {
		
		index1=clips1.length-1;
		index2=clips2.length-1;
		index3=clips3.length-1;
		index4=1;
		nextClips(clips4,index4);
		for (var i4:int = 5; i4 <25; ++i4)
		{
        this["index"+i4]= 0;
		}
		counter.text=String(index4);
		total.text=String(clips4.length-1);
		this.addChild(backbtn);
		this.addChild(counter);
		this.addChild(total);
		of.alpha=100;
}
	
if(event.target == course.dropdown_mc.b5) {
		
		for (var j5:int = 1; j5 <5; ++j5)
		{
        this["index"+j5]= this["clips"+j5].length-1;
		}

		index5=1;
		nextClips(clips5,index5);
		trace(index4);

		for (var i5:int = 6; i5 <25; ++i5)
		{
        this["index"+i5]= 0;
		}
		counter.text=String(index5);
		total.text=String(clips5.length-1);
		this.addChild(backbtn);
		this.addChild(counter);
		this.addChild(total);
		of.alpha=100;
	}
	
}

function playBack(e:MouseEvent):void {
	
	if (index6){
		
		nextClips(clips5,index5);
	}
	
		else if (index5)
	
	{   
		index5 = (index5 -1);
		nextClips(clips5,index5);
		counter.text=String(index5);
		total.text=String(clips5.length-1)
		of.alpha=100;
		this.addChild(nextbtn);
		this.addChild(counter);
		this.addChild(total);
		
		if (index5 == 0)
		{
		nextClips(clips4,index4);
		counter.text=String(index4);
		total.text=String(clips4.length-1)
		//of.alpha=100;
		}
	}
	
	else if (index4)
	
	{   
		index4 = (index4 -1);
		nextClips(clips4,index4);
		counter.text=String(index4);
		total.text=String(clips4.length-1)
		of.alpha=100;
		
		if (index4 == 0)
		{
		nextClips(clips3,index3);
		counter.text=String(index3);
		total.text=String(clips3.length-1)
		of.alpha=100;
		}
	}
	
	else if(index3)
	
	{   
		index3 = (index3 -1);
		nextClips(clips3,index3);
		counter.text=String(index3);
		total.text=String(clips3.length-1)
		of.alpha=100;
		
		if (index3 == 0)
		{
		nextClips(clips2,index2);
		counter.text=String(index2);
		total.text=String(clips2.length-1)
		//of.alpha=100;
		}
	}
		else if (index2)
	{   
		//trace(index2);
		index2 = (index2 -1);
		nextClips(clips2,index2);
		counter.text=String(index2);
		total.text=String(clips2.length-1);
		//of.alpha=100;
		
		if (index2 == 0)
		{
			nextClips(clips1,index1);
			counter.text=String(index1);
			total.text=String(clips1.length-1);
			//of.alpha=100;
			}	
	}
	
	else if (index1 > 1)
	{
		index1 = (index1 -1);
		nextClips(clips1,index1);
		counter.text=String(index1);
		total.text=String(clips1.length-1);
		//of.alpha=100;
		
				if (index1 == 0)
		{
			removeChild(nextbtn);
			oneClip1()
			counter.text=String(index1);
			total.text=String(clips1.length-1);
			//of.alpha=100;
			}	
	}
	
	else if (index1 ==1)
	{
		index1 = (index1 -1);
		index1=0;
		oneClip1();
		removeChild(backbtn);
		this.removeChild(counter);
		this.removeChild(total);
		counter.text=String(index1);
		total.text=String(clips1.length-1);
		of.alpha=0;
	}
	
}

backbtn.addEventListener(MouseEvent.CLICK, playBack);
/*
*/

Open in new window

The file is too larget I believe to upload.
ASKER CERTIFIED SOLUTION
Avatar of designaire
designaire
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
figured out the solution