PDA

View Full Version : AutoPlay folder problem


melblanc
02-11-2008, 01:14 PM
Ok, I posted a thread asking for help on the TrimLeft action (and got it, thanks!) but when working on it I realized that my problem was quite a bit more complicated.

Some images in my project are dynamic. I do this by setting whatever variable and depending on it's value I set a different image. Now the image is there no matter what, it's only the color that changes. So what I did is use the Image.SetProperties function and assigned ImageFile = whatevervariable. This works like a charm.

However when I build my project I have to change the AutoPlay folder name. Doing this every function works fine except any image using the above code. The images do not display and I get the missing image placeholder.

I have tried hardcoding the new folder name, setting a variable, everything I can think of but nothing works. And unfortunately I HAVE to change the name of that folder for it to work where it's destined to (wierd system admin thing going on there...).

Any ideas?

TimeSurfer
02-11-2008, 03:03 PM
Iit could be any number of reason's. Can you show us the code that's not working? It would be easier to help you. Also I'm a little unclear why you would have to change the folder name. Can you clarify?

melblanc
02-11-2008, 03:48 PM
Here is the rogue code:

numLoopCount = 1;
repeat
Image.SetProperties("statbar_" .. numLoopCount, {ImageFile= "AutoPlay\\Images\\" .. xstatus .. "_" .. numLoopCount .. ".gif"});
numLoopCount = numLoopCount + 1;
until
numLoopCount == count;


This is an example. There are other places where I use this and where it crashes as well. the key is the line ImageFile= "AutoPlay\\Images\\". Each time I use this it bugs, otherwise it works.

As far as changing the name, it's because if it's called AutoPlay it will get wiped every week; it's a feature on the servers that deletes any file name or folder with key words in them, and Play is one of them... I know....... trust me it causes a lot of headaches.

RizlaUK
02-11-2008, 06:37 PM
its because the function is expecting a indexed table and you have entered 1 table item


try it like this
numLoopCount = 1;
repeat
tbImageProps={}
tbImageProps.ImageFile= "AutoPlay\\Images\\" .. xstatus .. "_" .. numLoopCount .. ".gif"
Image.SetProperties("statbar_" .. numLoopCount, tbImageProps);
numLoopCount = numLoopCount + 1;
until
numLoopCount == count;

but it would be easer like:
numLoopCount = 1;
repeat
Image.Load("statbar_" .. numLoopCount, "AutoPlay\\Images\\" .. xstatus .. "_" .. numLoopCount .. ".gif");
numLoopCount = numLoopCount + 1;
until
numLoopCount == count;

melblanc
02-12-2008, 03:45 AM
Thanks RizlaUK, I realize the flaws in my code - especially that I plain missed Image.Load!. Unfortunately I've tried both methods and I hit the same wall... exact same problem. :huh

melblanc
02-22-2008, 08:51 PM
Anyone able to help me? I've tried everything...