First time not second

Hello does anyone know how to make a movie load the first frame the first time, but if it is the second time the page is being viewed to skip over the first frame? I have a pre-loader which is located in the first frame and when revisiting the movie the loader always pops up for that split second. How can I solve my problem. Or what should I do? Thank you,
Marc:hat:

u could create a variable on the main movie that increments a variable whenever the button to load the new movie is clicked, and have it check what frame to go to based on the value of the variable…

So have the variable start at 1, if first time have it go to frame 1, then if its greater then 1 (every time after the first) have it go to frame 2…

Not sure on the exacts of how to do this, but hey, the ideas there :slight_smile:

Yoshi I don’t think that’ll work cuz the swf will reload so it won’t make any difference.

What you could try is find a PHP script for cookies, write the var to that cookie, read it at the beginning of your swf somehow. That should work I guess.

But I have absolutely no idea how to do that …

Thanks to both of you for the ideas. I think perhaps I am over my head on this topic but you both have given me the foundation to at least try. Thanks again,
Marc:elderly:

It could be done with PHP. To make a cookie the first time and then send a variable to the flash movie upon return to be used in actionScript to gotoAndPlay(beyondPreLoader); . You will need PHP on your server to have it work, though. I’m learning PHP now, it’s pretty cool!! (-:

im not sure of what your Q is but i think this will help…


if (getBytesLoaded() == getBytesTotal()) {
	//gotoAndPlay (start);
} else {
	//gotoAndPlay (load);
}

…and i think it would be better to start everything on (atleast) frame 2… i mean, sometimes, flash skips some frames when loading… maybe it’s better to give flash atleast 1 frame to breath and load everything…

Ainriail - is talking I think about coming back to the beginning of his movie - not re-loading the whole swf…
anyway use the code noxious gave before anyother code (ie before loading/displaying preloader pics)

maybe it’s better to give flash atleast 1 frame to breath and load everything…

:beam: let him breath :beam::beam:

Freddy Thunder, where can I go about learning this PHP? If you could help me out at all that would be most apreciated. And By the way, your book, was funny as hell. I really could relate having worked at Taco Bell for 3 years in high school. But working at the airport, man that must suck. Thanks,
Marc

Hey! Thanks for checking out the book! I think it’s funny too, but I’m a little bias…You should get a copy and spread the word around Hawaii (hint :wink: )!!

Anyhow, with your PHP thing: PHP processes scripts before launching the HTML and whatever server it’s on must support PHP. PHP is server-side scripting language that is explained in this forum:
http://www.kirupaforum.com/forums/forumdisplay.php?s=&forumid=11

What I had in mind in my post is the same thing that Noxius put in actionScript. Just to see if the movie is cached (which would make getBytesLoaded()==getBytesTotal) and then just skip the preloader.

Another thought that I had was to have two seperate swf files and have PHP plant a cookie the first time and launch the swf with the preloader; then upon return, PHP would see the cookie and launch the swf WITHOUT the preloader.

However - if all you are trying to do is skip a preloader, try what Noxious said, it’s easier, cheaper, and you don’t have to learn PHP to do it.

If you have any other q’s let us know!!

Again thanks to everyone who is trying to help me out. And Freddy Thunder, I will check out if Borders has your book because in the area I live you either worked at a surf store or you worked in a resturant in high school. Since my friends and I opted to play hockey and lacrosse instead of surfing we all worked in the food industry and have our own set of stories, so I will definately check out your book and I know they will get a kick out of it also.
Mahalo Nui Loa,
(thank you very much)
Marc

That’s cool! Except it’s only in the Borders in Phoenix (for now) I’m trying to get their wholesaler number, but it’s in their computer. You can order it on my website, if you want. I suppose I should try to get it in Hawaii, it’s gotta be mostly hospitality work down there. And, I know, everybody tells me that they want to add stuff into the next book…:crazy:

So, Mahalo Nui Loa!!

Thanks again to everyone, especially Freddy Thunder. I went to phpbuilder and left a message on their forums and solved the problem. If anyone is wondering what it was, send me a message on kirupa and I will send you what I was told. It totally works. Thanks again for the help, without it I still would not have considered PHP an option or known what it was. message me if you get your book to any major bookstore in Hawaii. Thanks again everyone,
Marc

I want to know what you were told. Could you post it here? Or is it too long? And about the book, I will let you know!!

Sorry again for taking a long time to reply, it is summer and I took a couple days off of work. This is what the person on phpbuilder.com told me to do.

<?php session_start();
Session_register (‘flashSeen’);
?>

This goes into the html coding of the page, I put this right after the coding for the title. Next after the “src=” portion you have to append the URL with “?flashSeen=True”
Finally in the begining of the flash document on the preloader section of the movie, [AS]if (flashSeen == True) then gotoAndPlay(3)[/AS]
This worked rather nicely. Thanks again for all of the quick replies. Thanks again Freddy Thunder for the direction twords php.

Thanks,
Marc:pope:

I’m glad it worked out the way you wanted. Now that I’ve done a little more with PHP, I’ve learned about sending and loading variables and I’m glad that it’s doing that fast enough for you. That wasn’t a concern earlier, because I didn’t know about it.

All in all - it’s good that it all worked out for you!!