PDA

View Full Version : please help...movie refreshing after a couple seconds


JasonB
11-30-2003, 04:43 PM
I have NO idea what is going on here...but you can see it by going to
www.jasonbdesigns.com/clearpoolandspa/flash/

the main swf includes the nav bar, music and footer/music controls. it loads separate swf's, home and products are the only ones that are done. Home will load and play. the rest will not. do I need to UNLOAD previous movies?

I put the source up at http://home.alltel.net/jayd4wg/main.fla

i have the rest of the fla's up too, PM me to provide you the link...it's 5.7 meg in a zip...

Slowburn
11-30-2003, 04:50 PM
where are you loading your movies into? Levels or another movieclip?

If it's a movieclip, then your loading code may be wrong. or you have some command that is loading home again.

If it's levels, you should not load into level 0 again, or it will overwrite everything in the main.swf.

BTW, your .Fla file does not exist with that link.

Colin Campbell
11-30-2003, 04:55 PM
myHolderMovieclip.unloadMovie();
//or:
_level1.unloadMovie();


That should be what you want.

JasonB
11-30-2003, 04:59 PM
sorry bout the link...

http://home.alltel.net/jayd4wg/clearpool.zip has all the movie files minus images, but for testing imags can be pointed to www.jasonbdesigns.com/clearpoolandspa/flash/images/

do i need to unload the movies when i go to a new one?

JasonB
11-30-2003, 05:00 PM
i'm loading into a movie clip. I havent' grasped the concept of levels yet. this site is really my first attempt at a full flash site with navigation and such. I usually use flash for "nick nacks" on HTML sites.

I have added a movieClip.unloadMovie(); command to the navigation MC, and this didn't clear the problem. so i had the main.swf initialize with about.swf as the first screen...and all is well until you load home.swf. so now i know at least that the problem is in home.swf...and i have a feeling that it's in the photo slideshow MC. we're getting there :sigh:

JasonB
12-01-2003, 08:32 AM
okay...i stared at this code till the wee hours of the morning, and i'm back up and at work now no further ahead than i was. Well...that's partially not true. I have isolated the problem to the photo gallery movie clip on home.swf but i can't figure out what the hell is wrong with it. can someone please take a look at the script in MC galleryContainer on home.fla and see where there may be a possible conflict?

the thing that really disturbs me is that it's causing the whole movie to reload...main.swf too, and this is causing the music clips to stack and play at the same time...I let it go for a bit today and as you keep clicking on to other links it keeps loading the initial song again and i had 7 layers of it going at once.

I commented out all the code in that MC, and the movie works fine...matter of fact, here is the code:

on frame one of galleryContainer:


this.pathToPics = "images/pool";
this.totalImages=10;
this.fadeSpeed = 10;
this.pIndex = 0;
this.lastIndex=undefined;
this.pause=5000;

//create holders for all of your images inside photoFrame
for(j=0;j<totalImages;j++){
//create a Movie Clip inside photoFrame called "holder"+j
_parent.photoFrame.createEmptyMovieClip("holder"+j,j);
//create a Movie Clip inside photoFrame."holder"+j called photo
_parent.photoFrame["holder"+j].createEmptyMovieClip("photo",0);
//set the "holder"+j Movie Clip _alpha to 0
_parent.photoFrame["holder"+j]._alpha=0;
//set the "holder"+j Movie Clip _visible to false. (otherwise the movie will run really slow
//because flash has to calculate all the alphas even when alpha = 0.
_parent.photoFrame["holder"+j]._visible=false;
//give "holder"+j a flag variable so that we know if it has been loaded this way you only load it
//one time.
_parent.photoFrame["holder"+j].loadStatus=false;
//function to fade in
_parent.photoFrame["holder"+j].fadeIn=function(){
this._visible=true;
this.onEnterFrame=function(){
if(this._alpha<100){this._alpha+=fadeSpeed;}
else{delete this.onEnterFrame;}
}
}
//function to fade out
_parent.photoFrame["holder"+j].fadeOut=function(){
this.onEnterFrame=function(){
if(this._alpha>fadeSpeed){this._alpha-=fadeSpeed;}
else{this._visible=false; delete this.onEnterFrame;}
}
}
}



frame2 of galleryContainer:


//check our loadStatus flag variable if it is still false we load the movie if it is not false
//we do nothing and move onto the next frame
if(_parent.photoFrame["holder"+pIndex].loadStatus==false){
loadMovie(pathToPics+pIndex+".jpg", _parent.photoFrame["holder"+pIndex].photo);
}


frame3 is empty, frame 4 contains:


stop();
//check to see if the images ia already loaded if it is not loaded then we need to check its
//bytes loaded
if(_parent.photoFrame["holder"+pIndex].loadStatus==false){
BL=_parent.photoFrame["holder"+pIndex].photo.getBytesLoaded();
BT=_parent.photoFrame["holder"+pIndex].photo.getBytesTotal();
if(BL >= BT && BL>0){
//the image is now loaded so we set the load status to true
_parent.photoFrame["holder"+pIndex].loadStatus=true;
//then we fade it in
_parent.photoFrame["holder"+pIndex].fadeIn();
//check to see if there is another image visible
if(lastIndex!=undefined){
//if there is we fade it out
_parent.photoFrame["holder"+lastIndex].fadeOut();
}
nextFrame();
}//if the load is not completed the we return to frame 3 so we can loop through our check again
else{gotoAndPlay(3);}
}
else{//if the image is already loaded we fade it in and fade out the visible image
_parent.photoFrame["holder"+pIndex].fadeIn();
if(lastIndex!=undefined){
_parent.photoFrame["holder"+lastIndex].fadeOut();
}
nextFrame();
}


and finally, frame5 contains:


stop();
//we just pause for the duration set in the pause variable
pauseInterval=setInterval(waiting,pause);
function waiting(){
//change our indexes
lastIndex=pIndex;
pIndex++;
if(pIndex>=totalImages){pIndex=0;}
//move back to frame 2 and start again
gotoAndPlay(2);
clearInterval(pauseInterval);
}


there is no more script in this MC, or on any instances of it.

I'm on AIM and Yahoo all day if anyone wants to chat me about this...screen name is jayd4wg

thanks in advance for any help

CyanBlue
12-01-2003, 08:48 AM
Howdy... ;)

Just out of curiosity... What is your problem??? I see that the refreshing stuff is not there anymore when I checked the given URL... At least I don't see it...

Can you tell me which button to push to see it happening???

JasonB
12-01-2003, 09:33 AM
Originally posted by CyanBlue
Howdy... ;)

Just out of curiosity... What is your problem??? I see that the refreshing stuff is not there anymore when I checked the given URL... At least I don't see it...

Can you tell me which button to push to see it happening???

http://www.jasonbdesigns.com/clearpoolandspa/flash/

I just hit it again, and it's refreshing the whole movie for me. once the movie loads, click on any of the nav links, try products. products ran for a couple seconds then went right back to the home screen...

I'm on a p3 400 win2k, up to date flashplayer and IE. all updates and patches have been installed, and my connect here is a t3.

It does it for me at home too on dialup, p3 800, xp Pro, same flash and IE.

CyanBlue
12-01-2003, 09:43 AM
Um... Okay... The site is fully loaded, I think...

I see 'Crystal Clear Pool and Spa' and the rotating pictures and the text along with the sound...

If I click on the Products menu, I get to see the same texts with rotating images... The music sounds abit weird though... I feel like it's looping on top of each other... I mean two instances of the sound clip...

I feel like you have some infinite loop somewhere in your movie cuz I am having hard time typing this reply at the moment... My system is too slow, but if I close that page, it is fine... You might want to check it out... ;)

So, basically, I do not have that thing happening on my W2K/700Mhz/IE6/FP7.0.14.0/56k... :confused:

splict
12-01-2003, 11:10 AM
Well,
I was hoping to help, because I had this same problem not that long ago. But your fla's won't open for me. 'Unexpected file format' error. Are you using flash mx or flash mx 2004? or is my computer just wacky?:D

-splict

JasonB
12-01-2003, 11:12 AM
actually, it is happening for you. main.swf is the navigation and music, which loads content into a movie clip. this starts with home.swf, and using the nav buttons you can get to about, products, services, and care swf's. if I init the movie with anything other than home loading into the MC first and go to any of the other links, it works fine. then load home.swf (link in about - blank box) it will look like it's working fine until you go to another link. Do i need to unload the empty movie clip created in home.swf in the galleryContainer MC?

JasonB
12-01-2003, 11:13 AM
splict, i'm re-saving them as FMX. they will be uploaded in about 3 mins

okay..it's up

http://home.alltel.net/jayd4wg/clearpool.zip all files FMX...not FMX2k4

splict
12-01-2003, 02:53 PM
JasonB,
Just downloaded the stuff when you bumped the thread. got an idea or two, but i can't replicate the error. This is probably because my slideshow won't work. I am getting a 404 error for the pics. Are they supposed to be at http://www.jasonbdesigns.com/clearpoolandspa/flash/images/0.jpg etc.?

-splict

JasonB
12-01-2003, 04:42 PM
Originally posted by splict
JasonB,
Just downloaded the stuff when you bumped the thread. got an idea or two, but i can't replicate the error. This is probably because my slideshow won't work. I am getting a 404 error for the pics. Are they supposed to be at http://www.jasonbdesigns.com/clearpoolandspa/flash/images/0.jpg etc.?

-splict

yeah, images= [pool0.jpg,...pool9.jpg] in that directory.

see if that helps

splict
12-01-2003, 06:03 PM
I added the 'pool' and now the slideshow works - but still no errors. :o I even uploaded it to my server to see if it was a local thing but no... Still works fine! I must be doing something wrong (or accidentally doing something right ;))
suggestions?

-splict

JasonB
12-02-2003, 10:24 AM
link me to where you have it uploaded...lemme see if what i get is the same as on my server. cus it does it locally on my machine too :(

if you use aim or yahoo, hit me up there, jayd4wg

splict
12-02-2003, 11:40 AM
i pm'd you a bit ago. I only have msn/irc though, no aim or yahoo.

-splict

ericlin
12-02-2003, 11:57 AM
You may try first changing the script at the end of product.swf

_root.contents.loadMovie(products2.swf);

To

_root.contents.loadMovie("products2.swf");

Otherwise the product.swf kills itself to nothing.

JasonB
12-02-2003, 12:02 PM
Originally posted by ericlin
You may try first changing the script at the end of product.swf

_root.contents.loadMovie(products2.swf);

To

_root.contents.loadMovie("products2.swf");

Otherwise the product.swf kills itself to nothing.

Good catch...i hadn't gotten that far yet :rolleyes:

JasonB
12-02-2003, 04:31 PM
RESOLVED (for now)...

looks like this was a pretty simple fix, but a hard problem. thanks to splict for finding this...or fixing it anyway.

the problem was in the PathToPics property...i had a relative link. with the relative link, the movie fails. with an absolute link to pics with the full addy of my images folder, it works fine. kind of a PITA, but whatever...it works. I guess in order to implement this I will have to include this pathtopics in the remotely loaded text file for my customer.

JasonB
12-03-2003, 10:48 AM
I jumped the gun. it's still balled up. i'm half ready to scrap the whole freekin movie >:O