View Full Version : As Basic as It Gets..Buttons, Layers, Etc..
TBoyB
07-13-2001, 05:48 AM
The whole "Movie Clips" has me baffled! Is an MC a different swf file? Will i have the main timeline as an swf, then each movie clip i creat as an different swf file? Are "layers" also "levels"? If I'm reffering to something on "lAyer" 3, do I do that by adding a reference to it being on "lEvel" 3?
I want to be able to "launch" a MC that is not viewable till the "button" is clicked, and place it in an "empty MC" since I will load various different "MCs" as they are clicked by different buttons into that same "empty MC" which of course wil be static as far screen location goes.
Probably Lame as questions go, but i'm blocked on this one, I've searched and searched, but no acceptable answers have presented themselves. I've even got the Flash 4 Bible, and it is wanting of better explanation of MCs, which to me, seem like the "key" to the "hiper active, awe inspiring", sites that I've seen.
This Forum is the only place I have found with an active and informed following. I hope someone can help me, or at least link me to a site that caters to the ultimate in newbie questions regarding flash -most of the links in F4B do not work, that was proly in the printing process three years ago, so not surprising.
red penguin
07-13-2001, 04:00 PM
So, no, a MC is not another swf. You can create a MC with a blank first frame with stop(); on the 1st frame. Label your 2nd frame and then fromt he button on the main timeline, you can target the mc, which you MUST label!
on(release){
_root.yourMCinstanceName.gotoAndPlay("yourFrameLabel");
}
Layers and levels are NOT the same thing. Layers are the "sheets" we place objects onto when creating in Flash. Levels are when we load movies, dupe clips...they are placed into different, higher, levels.
Hope it helps...
-red
TBoyB
07-14-2001, 06:25 AM
It does help, clears up some confusion.
Now that code if I understand correctly is for Flash5, what is that code for Flash4? I wish to publish in Flash4 because of it's wide spread user base, something like 97% of browsers can play Flash4 content according to the stats I read.
Couple more question if I may;
what is the code to target the empty MC that I wish to load the various MCs into, and in Flash4 again, how do I set the position and size of that "empty" MC? Let's assume I call the empty MC "empty". And is it better to load these various Mcs into an empty MC, or just better to design them the size I want and load them onto different layers? The Empty MC sounds better, since it will unload the previous MC and sounds like it offers better control
When I did get the MC in question to work, it only displayed on screen for a split second and the actual MC did not seem to play fully. When I make an MC and save it in the library then place it on stage, do I only need one frame in one layer for it, despite the # of frames in the initial MC when I designed it, is that correct? I do understand that the MC must be loaded, so that's why it is placed in frame 2 of it's corresponding layer with a stop action at frame 1. Is this correct again?
Finally, I only need to set the size of the "empty" MC as it is refered to in the button code:
on (release) {
_root.MCtoBeLoaded.gotoAndPlay ("framelable", "empty");
setProperty ("empty") x=0
setPropety ("empty") y=40
}
is that the correct basic syntax? And, do spaces have an effect on the code? or could it all be one line no spaces?
ie: on(release){_root.MCtoBeLoaded.gotoAndPlay("framlble","empty");setProperty("empty")x=o...etc...
Thanks again, appreciate the help. All of us are Newbies at some point.
red penguin
07-14-2001, 10:00 AM
One thing at a time here. A MC has it's own independant timeline. You should do some basic tests before proceeding to a larger, more intense project. Once you understand the basic principles, you can then apply them to the larger project without having to worry about unexpected results.
New Movie. Create new clip. Give it 50 frames. Tween an object from one to 50. Stop action on last frame, label first frame. Save and drag it to the stage. Name it. On first frame of main timeline, put a button on a separate layer. give it the code mentioned before targeting the clip and first labeled frame. this will tell it to play. Notice, your main timeline is only one frame, but the MC is 50. It will play even though you only have one. However, remember? You have a stop statement at the end. You can remove that & it wil loop. OK? you there? Experiment with controlling MC's from different timelines, multiple clips, different buttons, stop, start, empty first frame with stop, etc. These small tests will help you in the long run. It may seem tedious, but believe me, you will learn.
on (release) {
_root.MCtoBeLoaded.gotoAndPlay ("framelable");
_root.emptyClip._x = 100;
_root.emptyClip._y = 40;
}
This is F5 syntax You have to use tell target syntax but I'm not a fan of regression.
You should think about the empty first frame thing. If the mc's arent too big, you can have them all on their own layers, centered, wherever. Even tell them where to be when they play.
Experiment. Have fun.
-red
Madtoe
07-28-2001, 10:13 PM
Hi,
There is an excellent CD to understand MC, Levels and ActionScripting... Advanced Flash 5 by Josh Ulm and Garo Green. Check it in http://www.lynda.com . The CD starts from the beginner to advanced actionscipting. It tells you the concept of addressing paths, variables, objects, methods, functions, properties, etc. I recommend you to get it and it'll clear up the confusions.
L-A :)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.