View Full Version : variable pictures/jpegs
neonleif
02-25-2004, 06:20 PM
In extension of this thread (http://www.actionscript.org/forums/showthread.php3?s=&threadid=35143) concerning the banner at this site (http://www.slagtojctr.dk/)
Some time ago I made a nice dynamic banner where a webmassa could change txt, links and pictures. Well, it worked when I got paid, but now it dosn't :(
The problem is that the pictures do not change after the webmaster has uploaded a new jpeg.
My first thought was "haha! disable internet cache!" But how do I do that in a swf?
download the files and try switching the names of the jpegs and see if it loads the same picture. It works fine on my system. But I'm still getting complains about it.
Thats probably the hardest job i've ever done!(doing) -seem so simple, but it's like a cartoon where i'm the coyote and the banner is the roadrunner :,(
neonleif
CyanBlue
02-25-2004, 08:12 PM
Well... It was loading on my machine, so the JPEG file is not the pregressive format... The only thing I can GUESS is that you are not giving Flash enough time to load the JPEG files??? But then, there is no way I can GUESS what you have in that file... :)
neonleif
02-26-2004, 05:41 AM
Originally posted by CyanBlue
The only thing I can GUESS is that you are not giving Flash enough time to load the JPEG files??? But then, there is no way I can GUESS what you have in that file... :)
I used the bandwidth profiler (@56k) to give it extra loading time, so that should be fine unless the external files does not affect the BP.
About what's in the .swf-file (if thats what you're asking)... I was unlucky enough to lose the .fla during a reinstall, so i'm working on that. But it's kinda described in this thread. (http://www.actionscript.org/forums/showthread.php3?s=&threadid=35143)
Current problem is that the jpeg is not switching... they tell me.
And i'm trying hard to make it not do that :rolleyes:
neonleif
03-13-2004, 06:48 AM
say something... is it a browserthing (html) or can I do it from inside the banner?
CyanBlue
03-13-2004, 04:57 PM
Hm... Yeah... Somehow this thread slipped out of my hands...I used the bandwidth profiler (@56k) to give it extra loading timeWhen I said 'you are not giving Flash enough time to load the JPEG files' I meant that you should have some sort of loop that checks if the image file is loaded into the Flash or not... That has nothing to do with the bandwidth profiler... As a matter of fact, bandwidth profiler can give you some estimation on how long it might take to load the file, and NOTHING else... Know what I mean???
neonleif
03-17-2004, 08:59 AM
guess i'm slippery :D
Ok, so what you're saying is that the swf just grabs the cached jpeg because it didn't had time to load the new one?
Interesting :)
What would you recomment? addListener with some sort of if-statement? Or is there a better way?
In other words what does check if external files are loaded and what does not (hmm, of those we n00bs might think would)?
CyanBlue
03-17-2004, 10:02 PM
I mean this sort of loop...
http://www.actionscript.org/forums/showthread.php3?s=&threadid=25372
http://www.actionscript.org/forums/showthread.php3?s=&threadid=23614
neonleif
03-17-2004, 10:08 PM
Thanks a lot, what would the world be without you...
CyanBlue
03-17-2004, 10:22 PM
That'll be the normal world... :)
neonleif
03-19-2004, 07:11 PM
Well... There's somthing that's not right about that onEnterFrame-function.
It only checks if the first .jpg is loaded.
I havn't tried it on the text, but would it work there aswell (if I get to make one that works)
I thought about looping it in a for or while, but I really don't know much of that yet... so... if anyone have suggestions...
Here goes:
// ActionScript... not PHP.
// create holder1:
// invent loop that does it 3 times so I don't need to hardcode holder2 and holder3
this.createEmptyMovieClip("holder1", this.getNextHighestDepth());
this.holder1._x = 20;
this.holder1._y = 30;
this.holder1.loadMovie("banner/flash1.jpg");
// creating holder2:
this.createEmptyMovieClip("holder2", this.getNextHighestDepth());
this.holder2._x = 278;
this.holder2._y = 30;
this.holder2.loadMovie("banner/flash2.jpg");
// creating holder3:
this.createEmptyMovieClip("holder3", this.getNextHighestDepth());
this.holder3._x = 538;
this.holder3._y = 30;
this.holder3.loadMovie("banner/flash3.jpg");
// load knapper:
this.attachMovie("knapper", "knapper", this.getNextHighestDepth());
this.knapper._x = 95;
this.knapper._y = 24;
// load text and links
this.knapper.loadVariables("banner/flash.txt");
// assign links to the buttons
// invent loop that does it 3 times to prevent hardcoding knap2 & 3
this.knapper.knap1.onRelease = function() {
getURL(knapper.link1, "_blank");
};
this.knapper.knap2.onRelease = function() {
getURL(knapper.link2, "_blank");
};
this.knapper.knap3.onRelease = function() {
getURL(knapper.link3, "_blank");
};
// attach curtain on top of everything
// thought about masking it all or a setInterval or onEnterFrame for the alpha once the images are all loaded
this.attachMovie("curtain", "curtain", this.getNextHighestDepth());
//************************************************** *
// check if the images are loaded: (curtesy of CyanBlue)
this.onEnterFrame = function() {
if (0<this.holder1._width || this.holder2._width || this.holder3._width) {
delete this.onEnterFrame;
// do something when the images is loaded:
this.curtain.gotoAndPlay(2);
} else {
this.curtain.gotoAndStop(1);
}
// end if
};
// end onEnterFrame = function()
//************************************************** *
It's clear if you have a slow connection otherwise you can see it if hit "testmovie" twice... (where flash simulates a given connectionspeed). But I bet you know that ;) .
I've uploaded the thing here (http://nisch3.mudweb.dk/banner.htm)
Now the Unicoding skroo's up again, but leave that for now...:mad:
CyanBlue
03-19-2004, 10:34 PM
Well... Just by the look of your if statement, it looks like you have to use && rather than || because you want the all the conditions to be true... Try this and let me know if it worked or not...if (this.holder1._width > 1 && this.holder2._width > 1 && this.holder3._width > 1)
neonleif
03-20-2004, 04:45 PM
Right. That did it. Thanks a lot!
I got the || separantion from this thread: http://www.actionscript.org/forums/showthread.php3?s=&threadid=27676
Maybe it isn't right, or is it ment for something different?
Anyway the && did the job and now to the URL-encoded txt-file.
In a previous thread I had the problem with special characters solved, just by saving the file in Unicode. Then it didn't even show the carrige-returns. That was with Flash MX, but now, in Flash MX 2004, two rectangles appear at each return.
I know it would be easier to remove the returns from the txt-file, but I'd like to keep them for the sake of lightusers who should be able to edit it without too much trouble.
I'm not sure if I should make this a new thread. Afterall the subject has changed a bit now...
CyanBlue
03-20-2004, 04:54 PM
Yeah... You should make a new thread when you think the subject is different since we don't want to cover the whole project in one thread... :D
neonleif
03-20-2004, 05:06 PM
well.. maybe I should rename this thread "Make my Project" :-)
Thanks a lot for your help, I'll be in touch ;-)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.