Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Movie in background 1

Status
Not open for further replies.
Jan 26, 2001
550
GB
Heya guys, i have two movies which comprise one whole site. Is there any way that, after the first movie has loaded, i can tell the second one to load in the background as the user navigates through the first movie(so it is already prepared when the user wants to access that part of the site.)

Thanks in advance ;) Nick Price
nick.price@misuk.net
 
hi Nick

just stick a Loadmovie action in the first frame of your initial movie. If you put a blank frame and stop action in the first frame of the second movie it won't show until you specify it again from level0.

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
cheers buddy thats sorted!

if u got any free time would u be able to have a look at that furniture thing i posted a few days ago?? (the name of the thread is 'Hi, I don't know if this is simple......' (forgot to name it! hehe)

Thanks for all your help Dave,

Nick Price
nick.price@misuk.net
 
sorry to bother u again but im having a bit of trouble with this... Instead of using a separate movie for the second part i have added it as a new scene at the end of my first movie. I want the first movie to load all scenes except this one before it begins to run.

The file is around 1.2mb so i have included some of my code below, but if u want to see what happens have a look:


This is the actionscript for my preloader; there are actually 11 scenes in the movie but as i want the last one to remain unloaded until the movie starts playing i have specified 10.(is this where i have gone wrong?)

Frame1:

NumberOfScenes = 10;
iCount = 0;
while (Number(iCount)<Number(NumberOfScenes)) {
TotalFrames = TotalFrames + getProperty(&quot;_level&quot; add iCount, _totalframes);
iCount = Number(iCount)+1;
}
iCount = 0;

Frame2:

FramesLoaded = 0;
while (Number(iCount)<Number(NumberOfScenes)) {
FramesLoaded = FramesLoaded + getProperty(&quot;_level&quot; add iCount, _framesloaded);
iCount = Number(iCount)+1;
}
Progress = int(FramesLoaded*100/TotalFrames);
iCount = 0;

Frame 3:

// Loop checks value of Progress and tells PreloaderBar what frame to stop at.
if (Number(Progress)<100) {
tellTarget (&quot;PreloaderBar&quot;) {
gotoAndStop (../:progress);
}
gotoAndPlay (2);
} else {
tellTarget (&quot;/PreloaderBar&quot;) {
gotoAndStop (100);
}
gotoAndPlay (&quot;outside&quot;, &quot;start&quot;);
}

Ok so far? Now, within the movie there is a button which calls the last, partially loaded scene. If the scene is fully loaded it will play it, if not it brings up a window which tells the user to wait for a few moments....heres the actionscript:

on (press, release) {
stopAllSounds ();
ifFrameLoaded (&quot;Fruit Machine&quot;, &quot;lastframe&quot;) {
gotoAndPlay (&quot;Fruit Machine&quot;, 1);
}
tellTarget (&quot;_base, nofruit&quot;) {
gotoAndStop (2);
}
}


...where 'nofruit' is the popup window.
The problem is that the scene loads with the rest of the movie rather than after the main movie has started playing....any ideas how i could solve this? Any help would be greatly appreciated..

Many thanks,

Nick Price
nick.price@misuk.net
 
hi Nick

Just about to read the thread but thought I'd post this anyway for the minute. RE: the furniture. Sorry, I haven't been ignoring you or anything, it's just that it's getting into quite advanced scripting. What this means to you and me is that it gets put on hold until I have enough time and a concentration level to match (ie: this weekend), I'm sure you can appreciate this. We've been really busy pumping out paid work for the past week and constant meetings, so my schedules been tight-as-a-.... and I haven't had the time/concentration to sit down and thouroughly solve the problem, but I will (he says with an evil self-gratifying grin ;-) ). I noticed this is a commercial development of yours, how much of a cut am I getting for this? ;-) FYI, I would charge a small fortune for this level of scripting if I was approached by a company to do it contractually.

anyway, going to read your massive post above.

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
Heya mate, don't worry i fully understand that you're really busy so don't worry about knocking me down your list! Just a note to say a huge thanks for all the help you've given me over the past few weeks, it hasnt gone unappreciated. As you probably guessed im relatively new to flash (im only 22, just got out of college into a job!) and im the only guy who knows anything about it in the company! Before I started using this forum i had immense difficulty with even the most basic of actionscripting, and now thanks to you guys im getting the hang of some more advanced features, and feel generally at home within the flash environment. By the way when i go freelance, and im getting a small fortune, i'd be happy to come to some sort of arrangement with you as far as your cut goes ;-) ;-)

Anyway, look forward to hearing from you. Nick Price
nick.price@misuk.net
 
nick

I can't look at the file above, anything over 200kB and I lose patience (my connection is around 0.5K/s at best so when I am downloading something I'm knocked off the net during the download). But don't bother yourself to cut it down, I don't think I need it for the minute.

RE: the above scripting
WAY TOO COMPLEX, I'll fire-up a much simpler version of what you're trying to do, give me a few minutes.

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
ok Nick

In frame 1 of the first scene:

/:ddcount = _framesloaded;
if (/:ddcount> 432) {
gotoAndPlay (&quot;scene1start&quot;);
}

change the value 432 to the frame number of the final frame in scene 10 (you can determine this by putting a stop action in the final frame of scene10, test the movie and note the frame number where the movie stops on the bandwidth profiler). Change &quot;scene1start&quot; to the name of the label on the first frame of your movie.


In frame 2 of the first scene:

gotoAndPlay (1);


The above will only allow the movie play as soon as all scenes (except scene 11) are loaded.

dave

davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
If you can't integrate the 'bar' scripting yourself, then make me a cut-down version of the fla: just delete all scenes except the first, and delete all frames within the first except say the first 5 frames.

cheers
dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
thanks dave, im going to have a good look at it now, and i'll try to integrate the bar scripting myself. If I do get hopelessly stuck i'll call on you again, but i'll try not to bother you as much from now on ;-)

Thanks again for your help, Nick Price
nick.price@misuk.net
 
don't be shy about 'bothering' me Nick, if I can't do something right-away I do it when I get the time, no probs. Didn't mean to put you off in any way.

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
No worries geezer, all i meant was that from now on i'll make a more concerted effort to fix problems myself rather than jump straight on the forum every time there is something i dont understand...the amount you guys do for free on this forum when you've got 'real' work to do amazes me, and i just didn't want to appear as if i was taking this for granted. Rest assured, however, that you will be seeing more posts from me in the future!!!! LOL

Nice one! ;-) Nick Price
nick.price@misuk.net
 
Don't work too hard wee man! ;-) davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top