View Full Version : Oh My, I am having a problem loading my movies in my " main movie.
Djinn
02-11-2002, 03:13 PM
It seems Im lost when it comes to this command. I have everything else all set with flash 5. This last hurdle is killing me with time. I have read everything there is on the subject but just can not seem to grasp the concept in my head. I dont want to resort to having my whole movie on one timeline 10,000 frames long. Hehehehehe! The action script is getting me lost.
Im so sorry if I sound like a true Noob, but I am. I bought Flash 5, Fireworks, and Dreamweaver all at the same time 3 weeks ago. I have a website for an on-line game I play. I am producing an intoduction text movie with all the kewl flash5 graphics I've learned. But this is far harder then I ever fathomed. I dont want to go back to a plain html document website. Thank you so much for at least hearing me whine! :rolleyes:
Ricod
02-11-2002, 03:53 PM
MovieName = "mySWF.swf";
Location = "_root.myMC";
loadMovie (MovieName,Location);
replace all names ofcourse ... :)
Ahhh, loadMovie and loadMovieNum....
Definitely hugely useful methods in Flash. All the great sites use this to break things up and conserve bandwidth for slowpokes like me. A couple things you must understand before diving in though:
1. Level. What are levels? Imagine your timeline - it has frames that run from left to right, numbered 1 to 16,000 (the max frames that a swf can hold).
Now think about the layers on your timeline - when you export your movie, flash smooshes all the layers into a single layer called a LEVEL. Your final .swf only has one layer - remember that.
Your main movie is called level0 (zero) when thinking of levels. In case you don't know, zero is the first number in programming, not one.
What's really cool about level is that they are like the layers in your main movie before you export it. You can add new levels on top of you regular movie, a possible total of 16,000!!!. Allow me to describe an example.
My site (it's pretty weak right now) is http://www.dynactix.com . If you look at my site and click on the portfolio link, you'll see a bunch of file things you can click on and they will bring a little flash thing in screen. How does this work? Simple.
The portfolio is level0. (the main page WAS level0, but when you click on the portfolio link, I put the following actions on the button:
on(release){
loadMovieNum("portfolio.swf", 0);
}
I had portfolio load into level0 because I wanted it to replace the original movie(the main page) with the portfolio.
Then I added the following actions to the file buttons in the portfolio:
on(release){
loadMovieNum("name of portfolio item", 1);
}
Notice the number 1 at the end of the command instead of the number 0. The reason I did this is because I didn't want the portfolio page to disappear, I wanted the portfolio item to load in right on top! You can keep adding new stuff on top, just change the level number! Remember though, two things cannot exist on the same level at once. The new movie WILL replace the old one. At this point I'm sure you are seeing the endless possiblilities in front of you with just this simple action. Remember you can have sixteen thousand levels! That's sixteen thousand swfs you can have running on top of each other at the same time!
It get's me awful excited just thinking about it!
The stuff inside the
Ahhh, loadMovie and loadMovieNum....
Definitely hugely useful methods in Flash. All the great sites use this to break things up and conserve bandwidth for slowpokes like me. A couple things you must understand before diving in though:
1. Level. What are levels? Imagine your timeline - it has frames that run from left to right, numbered 1 to 16,000 (the max frames that a swf can hold).
Now think about the layers on your timeline - when you export your movie, flash smooshes all the layers into a single layer called a LEVEL. Your final .swf only has one layer - remember that.
Your main movie is called level0 (zero) when thinking of levels. In case you don't know, zero is the first number in programming, not one.
What's really cool about level is that they are like the layers in your main movie before you export it. You can add new levels on top of you regular movie, a possible total of 16,000!!!. Allow me to describe an example.
My site (it's pretty weak right now) is http://www.dynactix.com . If you look at my site and click on the portfolio link, you'll see a bunch of file things you can click on and they will bring a little flash thing in screen. How does this work? Simple.
The portfolio is level0. (the main page WAS level0, but when you click on the portfolio link, I put the following actions on the button:
on(release){
loadMovieNum("portfolio.swf", 0);
}
I had portfolio load into level0 because I wanted it to replace the original movie(the main page) with the portfolio.
Then I added the following actions to the file buttons in the portfolio:
on(release){
loadMovieNum("name of portfolio item", 1);
}
Notice the number 1 at the end of the command instead of the number 0. The reason I did this is because I didn't want the portfolio page to disappear, I wanted the portfolio item to load in right on top! You can keep adding new stuff on top, just change the level number! Remember though, two things cannot exist on the same level at once. The new movie WILL replace the old one. At this point I'm sure you are seeing the endless possiblilities in front of you with just this simple action. Remember you can have sixteen thousand levels! That's sixteen thousand swfs you can have running on top of each other at the same time!
It get's me awful excited just thinking about it!
Djinn
02-11-2002, 05:19 PM
ahhhhhh, it seems to be coming in clear now.hehehe. Now, let me get this straight. MC, meaning movieclip? Also, where do I place my movies on the main scene timeline? I know these are basic questions to many programmers, but once I understand the concept I will take hold and run away with it....
This I understand so far====
MovieName = "movie name.swf";
path ----------> Location = "_root.myMC"; ?
basic action ----------> loadMovie (MovieName,Location); ?
:confused:
Djinn
02-11-2002, 11:18 PM
Well, I have been at it for hours now and still can not load my movies.
This is what I am trying to accomplish-------------
I have 14 movies that I want to load by itself one after another with no user button command. On the stage I imported a music movie in frame 1. Next, I have another imported movie in another layer beneth it in the same time frame 1. I did the same to the next layer. When I test movie, I get all my movies playing at the same time. So, I moved all my movies over to frame 2 and inserted another layer labled " actions ". I tried loadmovie in my actions layer but when I try to test my movie again, I get, " generator error, can not find file for swf. movie ". This is where I am totaly lost. Do my movies have to be on the stage to give them load commands? If not, then where? From my library or my computer hard drive? I have been at this for days now and Im getting to the point of giving up with all hope lost. I have tried to read tutorials, but they have no clear step-by-step tuturial on this action. I am so sorry if I am annoying anyone with my ignorance. I am a desperate man looking for a clear cut an answer. Thank You all for your time :p
Ricod
02-12-2002, 08:09 AM
You're mixing up two terms here ...
movieclip and movie. A movieclip (mc) is a symbol within your Flash movie. To get a mc from your library onto your stage, u'll need to attachMovie it. The loadMovie is for external swf's.
The path to an swf depends on where u put it in your folder on your server/computer compared to the swf you are loading into.
Djinn
02-12-2002, 02:35 PM
OMG!Rico , when you said " folder ",I was sure I was doing everything right. But, I back tracked and found that all my movie .SWF were in seperate folders from my main movie.:eek: I fixed the path to my folders right away and with great joy, all my movies are now applied to my main movie with awesome load time. Thank you so much for not having a laugh on my expense. :o I am sure I will be posting again when another problem arises. Well, in all my confusion I seemed to learn a great deal about actionscript from actionscripts.org tutorials and all the great post on the forums. You guys are terrific! Keep up the great teamwork. See you all soon. :D
Ricod
02-12-2002, 03:38 PM
Heheh ! Thanks ...
But JRBT is the one u oughta thank. He's the one that did all the explaining ! So JRBT ... thins ones for u ! :)
I'm just glad there was something I actually knew about in question for once! LOL:p
Djinn
02-12-2002, 10:14 PM
:cool: Thank you for your insight JRBT! Your insight was very informative indeed. Nice job on your web site so far. It has all the actionscript dynamics that gets me all pumped up to learn more actionscript. I owe you both a great deed. :D
cablecharlz
02-13-2002, 07:27 AM
how do u set...how big each level is
for example on ur site u have 4..rectangles
how do u set hat level 1 is the top right,
and so on?
cablecharlz
02-13-2002, 07:32 AM
o ya 1 more question
can i make..each scene a different level?
or do i have to make each swf a new level
Okay, let me try to answer all these questions one by one - believe me, the levels navigation is the way to go in order to avoid that long initial download that non-flashers hate so much!
FYI: I use a PC running Windows, so my keyboard shortcuts will reflect that.
First question: (level sizes)
Each level (swf) that you plan to load on top must be the same dimensions as your bottom main movie and have the same background color - both of the options can be adjusted if you key in "Alt + M + M again" - that will take you to the "Modify Movie" menu.
Okay, once you are sure that your sizes and backgrounds are the same, you can begin to add your content.
I will again reference my own site (as crappy as it is right now!) because it is a great example of this discussion. When in the portfolio section - the following things must be understood first off:
1) the portfolio page has replaced the main page as "level0".
2) When you click on any of the experiments, they will load into "level1". (on top of the portfolio page, like a mask) If you click a second item, it will replace the last thing that you were viewing in "level1" - got it?
What I actually did on each experiment (and it doesn't get any easier than this!) is simply copy the two right side squares from the portfolio, then I went back to the new movie I just made and hit "Ctrl + Shift + V" (paste in place).
BOOM! I now have two new squares that will perfectly cover the old squares. This could of course be visually upgraded to make content change in a window on a button click, heck, you could do anything!
Most of the experiments are contained within the squares, and don't come out. I accomplished that by simply copying the top square, making a new layer, pasted the square in place(see keyboard shortcut above) and turned the layer into a mask layer.
Now nothing can escape me!!! HAHAHAHA1!!! Oops, lost it there for a second....
I hope that this will help you dive headfirst into becoming the last actionscript hero!
Question 2: (levels as scenes)
Yes, you can easily treat each swf as a scene, but a scene in your main movie is trapped in "level0" or whatever level your movie is currently in----:
e.g. Let's say you have three movies, each would be thought of as a scene. All you would have to do is instead of using a "gotoAndPlay()" function, you would use a "loadMovie()" function, if you use normal mode in the actions window, all you have to fill in is the path to the .swf, and the level you want it to appear in. You would use "level0" if you wanted the new movie to completely replace the old one, or make the level a higher number if you want the new content to lay on top.
The same rules at the beginning of this post apply in either situation.
Again, the benefit of this is breaking up the download time - speed!!! You could even add a "loadMovie" function on your first movie followed by a "setProperty" function to preload your other movies while on the main page, then either change their _x property to appear off stage and out of site, or set their _visible to "0" (invisible). I'm getting off track, but I want you to see what's off in the horizon, and why this is so useful!
No one wants to see the stale old load bar that takes forever, just to load the stupid intro, then you have to wait for the site to load too?!?!? Humans have short attention spans, especially those who have slower than molasses modems like me!!!
Enjoy your powerful new tool.
cablecharlz
02-15-2002, 02:43 AM
whohoo i finally understand!
thx so much jrbt
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.