LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
  #1  
Old 10-01-2002, 01:16 PM
spam spam is offline
Registered User
 
Join Date: Feb 2002
Posts: 12
Rep Power: 0
spam is on a distinguished road
problem with dynamic images

hi

i'm loading variables from a db (these are all defined as "folio_ ...") these generate a list of buttons that when clicked fill in some text fields with info from the db and load a few images

my problem is basically the last image doesn't load first time on of any of the buttons but after i've clicked on any of the buttons once they all work fine, i just can't seem to work out why

you can see an example here

here's the code
Actionscript:
onClipEvent(load){
	imageArray = new Array("001","002","003","004");
	
	for (i=1; i<=_root.numrows; i++) {
	
		this.attachMovie("clientListMC", "buttonMC"+i, i);
		this["buttonMC" + i].client_list_name = eval("_root.folio_name" + i);
		setProperty ("buttonMC"+i, _x, 60);
		setProperty ("buttonMC"+i, _y, 10 + (i*20));
	}
	
	onBtnReleased = function(mc) {
	    btnDestin = mc._name;        
  		whichButton = mc;
    }
    
    thumbMCs = function(){ 
		for(n=0;n<imageArray.length;n++){
			_root.attachMovie("thumbBtnMC","thumbMC"+n,(n+100));
			_root["thumbMC"+n]._x = 333 + (n*50);
			_root["thumbMC"+n]._y = 30;
		}
	}
	
	imageloadThumb = function(chosenThumbBtn){
    	thumb_picked = eval("_root.folio_variable" + chosenThumbBtn);
		for(i=0;i<=imageArray.length;i++){
			_root["thumbMC"+i].thumbHolder.loadMovie("folio_images/folio/" + thumb_picked + "/" + imageArray[i] + "_thumb.jpg");
		}
	}
	
    imageload = function(chosenBtn){
    	client_picked = eval("_root.folio_variable" + chosenBtn);
    	_root.testtext = "images/folio/" + client_picked + "/001.jpg";
		_root.client_details.bigview.loadMovie("folio_images/folio/" + client_picked + "/001.jpg");
	}
}


onClipEvent(enterFrame) {
	if (whichButton) {
		for(i=0;i<=_root.numrows;i++){
			if(btnDestin == "buttonMC" + i){
				btnClicked = btnDestin.slice( 8, 50 );
				
				_root.client_details.client_name = eval("_root.folio_name" + btnClicked);
				_root.client_details.client_description = eval("_root.folio_description" + btnClicked);
				_root.client_details.client_url = eval("_root.folio_url" + btnClicked);
				
				thumbMCs();
				imageload(btnClicked);
				imageloadThumb(btnClicked);
         	}
		}
		whichButton = null;
	}
}

any help would be greatly appreciated

regards
andy
  #2  
Old 10-01-2002, 04:47 PM
spam spam is offline
Registered User
 
Join Date: Feb 2002
Posts: 12
Rep Power: 0
spam is on a distinguished road
the weird thing is if i leave it about 15 secs then click a button it works yet the images don't actually load until you click a button

i'm even more confused now

regards
andy
  #3  
Old 10-01-2002, 09:38 PM
MixMatch's Avatar
MixMatch MixMatch is offline

Hyper Moderator
 
Join Date: Aug 2001
Location: Heidelberg, Germany
Posts: 1,789
Rep Power: 13
MixMatch is on a distinguished road
couple tips... you can and should take that code off of the movieclip an place it on the main timeline using:
Actionscript:
myMC = _root.whatever;
myMC.onLoad = function () {
//your function here
}
myMC.onEnterFrame = function (){
//your function here
}
Also, this:
Actionscript:
this["buttonMC" + i].client_list_name = eval("_root.folio_name" + i);
can be written as:
Actionscript:
this["buttonMC" + i].client_list_name = _root["folio_name" + i];

Finally, you can use the "onLoad" function to know when your pictures have actually loaded...
  #4  
Old 10-02-2002, 08:13 AM
spam spam is offline
Registered User
 
Join Date: Feb 2002
Posts: 12
Rep Power: 0
spam is on a distinguished road
bizarrely it works on ever other machine i use and even other browsers just not in IE either locally or over a server

cheers for the tips i'll try that out

regards
andy
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Images Scroller - Almost Finished alyken Actionscript 2.0 0 09-24-2008 10:36 PM
gif images problem madmag Newbies 1 09-07-2007 12:46 PM
Preload multiple Dynamic Images to cache in flash mx purdywurdy Flash MX 2004 2 01-26-2007 01:34 PM
script for slideshow... dynamic loading of images and URLs oquindrg General Flash 1 10-25-2006 02:00 PM
Dynamic Text for Flash Lite 1.1 (my big problem) jopeman All Things Apple 2 01-12-2005 03:14 PM




All times are GMT. The time now is 06:16 AM.