flash help
- Started
- Last post
- 5 Responses
- Bullitt
Can someone help me sort out this problem.
Got a flash movie that calls up images from a folder to play in the timeline (along a motion tween using just a fade in and out). problem I got is its calling up images that don't exist. Have 7 images... but it's going beyond that...
Here's the code I'm using:
if (imageCount==0) {
slide1.loadMovie('1.jpg');
imageCount = 2;
}
else
{
//slide1.loadMovie(imageCount + '.jpg');
imageCount++;
};
var fileExists=new LoadVars();
fileExists._parent=this;
fileExists.onLoad=function(succe...
{
trace(imageCount + '-' + success);
if(success)
{
slide2.loadMovie(imageCount + '.jpg');
}
else
{
imageCount = 1;
slide2.loadMovie(imageCount + '.jpg');
}
}
fileExists.load(imageCount + '.jpg')have another bit of code near the end of the timeline which is a transition between the first and last image.
imageCount++;
slide3.loadMovie(imageCount + '.jpg');
slide1.loadMovie(imageCount + '.jpg');how do I get that imagecount to stop at 7 and go back to 1?
CHEERS!
- lvl_130
couldn't you just add something like:
if (imageCount==7) {
slide1.loadMovie('1.jpg');
imageCount = 2;
}
else
{
imageCount++;
};
- Bullitt0
nah, for some reason it just still keeps going
- lvl_130
what if you change ==7 to ≥6?
- fyoucher10
I would seriously reconsider how you're creating this slideshow , otherwise you'll probably end up running into more problems later on.
For your images not appearing, it becuase they're not loaded yet. Check the MovieClipLoader Call in the help section. They have examples for exactly what you're trying to do.
Also, look into Arrays. It' like what you're trying to do but it a more compact form. It also would answer your last question.
Also, I've used this class in the past for loading external assets and I've found it to work great and extremely easy to implement, even for folks who don't know how to code.. There are examples right on the page for how to work it.
http://blog.greensock.com/preloa…
- Mishga0
Check one of theses image gallery for help (free to use, fla included, you just have to register)..some of them work with XML files, so it makes easier the updating process if you plan to add more pics....