Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 09-12-2004, 08:55 PM   #1
pcvnes
Registered User
 
Join Date: Sep 2004
Posts: 4
Default loadClip troubles.. and loadMovie working fine

I am a newbee in the flashworld, but am not trying to get a loadClip function working properly. Searching other posts, tutorials etc did not help. So this is my last resort for now.

I have a simple flash script which displays an unknown number of jpg files. The filenames start with 1 and end with... ? This is also the reason why i want to use the loadClip function, because i this function is capable of handling the loaderror exception. Then i know that the last file has been hit. Otherwise i have to load a text-file with the necessary arguments.

The fla has two timelines, "actions" and "Filmstrip". The timeline Filmstrip contains seven movieclips (slide0..slide6). The code below works fine with loadMovie (marked with "working great") only i want to use one of the other variants (marked with %^&^%& )

Any help will do!

Cheers

Peter

Code:
slide1._alpha = 100;

loaded = 0 ;
image = 1 ;
init = 1 ;
lasttime = getTimer() ;
slideheight = 100 ;
slidespacing = 10 ;
poscounter = 0 ;
lastslide = 6 ;
imginsert = 1 ;
// preload = 1 ;
z = 0 ;

var loader:MovieClipLoader = new MovieClipLoader();


dbgtext.Text = "Peter van Nes Photography";

_root.traceBox.vScrollPolicy ="on";
function myTrace(msg)
{
   _root.traceBox.text += msg + newline;
   _root.traceBox.vPosition = _root.traceBox.maxVPosition;
}

// Create listener object:
var loadListener:Object = new Object();
loadListener.onLoadStart = function (loadTarget) {
myTrace("Loading into " + loadTarget + " has started.");
}
loadListener.onLoadProgress = function(loadTarget, bytesLoaded, bytesTotal) {
var percentLoaded = bytesLoaded/bytesTotal * 100;
myTrace("%" + percentLoaded + " into target " + loadTarget);
}
loadListener.onLoadComplete = function(loadTarget) {
myTrace("Load completed into: " + loadTarget);
}

loader.addListener(loadListener);

_root.onEnterFrame = function() {
	
//myTrace ("tracing started") ;
if (init==1) {
	for (x=0;x<=6;x++) {
		this["slide"+x]._x = 5 ;
		this["slide"+x]._y = -slideheight + ((slideheight+slidespacing)*x) ;
	}
	init=0 ;


}


if ((getTimer() - lasttime) > 500) {
	for (x=0;x<=6;x++) {
	  this["slide"+x]._y = this["slide"+x]._y + 1 ;
	}
	
	poscounter++ ;
	
	if (poscounter > (slideheight+slidespacing)) {
 	  poscounter = 0 ;
	  this["slide"+lastslide]._y = -slideheight ;
// Working great	  
//  	  loadMovie("C:/Documents and Settings/Peter van Nes/My Documents/My WebDesign/petervannesphotography.com/img/"+imginsert+".jpg", "slide"+lastslide);
// Working not so good... in fact can not get it #$%^&*( working properly
//loader.loadClip("C:/Documents and Settings/Peter van Nes/My Documents/My WebDesign/petervannesphotography.com/img/"+imginsert+".jpg");
// also not working
 	  loader.loadClip("C:/Documents and Settings/Peter van Nes/My Documents/My WebDesign/petervannesphotography.com/img/"+imginsert+".jpg", "slide"+lastslide);

	  
	  imginsert++ ;
//	  dbgtext.Text = "Loaded: " + lastslide + "->" + This["slide"+lastslide].getBytesTotal() ;
		  
	  lastslide-- ;
	  if (lastslide < 0) {
		  lastslide = 6 ;
	  }
	}
	
}

}
pcvnes is offline  
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

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

Forum Jump


All times are GMT. The time now is 06:30 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.