View Full Version : Timeline, MC, button.....
Hi
I'm new to actionscript. I find that it's always confusing on deciding where the codes should go. Should it be on the main timelines, movie clip, button? Which one do you prefer?? With different object e.g. MC, Btn, I need to remember different way to initalise it.
e.g. 1
on (release) {
//do something
}
e.g.2
onEnterFrame = function () {
//do something
}
Moreover, should i write some OO programming and make some instances or simply add some scripts in the timeline......
help.............................
RL
:confused:
daniel
11-14-2002, 10:11 AM
i'm working on something where i find it useful to have a movieclip of the main navigation on one layer; 1 keyframe with frames throughout the whole FLA.
in the main nav, i direct buttons to different frames on the main timeline, with a small preloader for every picture it directs to.
so the buttons and their actions are in a movieclip called 'main navigation', with sub-buttons in a movieclip called 'submenu'
they direct to _root (which is ofcourse the main timeline) and then to a frame or framelabel
hope this is what you mean...
hi
thanks for your reply. not exactly what i mean but i can get some insights from your msg. sometimes i found the examples from macromedia do what you said. they put botton inside MC and just put 1 keyframe on main timeline...
but what i mean is that where would you prefer to put your codes. cause you could put your codes inside a btn, mc, a keyframe, framelabel or make a class of a mc or btn in library and then make a instance on the stage........ of course there will be some differnet in the codes on different situations, ex. btn vs mc.
so, what would you prefer in terms of programability, readability....
many thanks
rex
Ricod
11-15-2002, 03:14 PM
I can't really describe it better than that it will take some experience to decide what's best and it will always depend on the current situation.
The general rule I use is : What you have to put in a button or on a mc (like on (release) and onClipEvent() methods) you have no choice (usually) than to put it there. All the rest is best to be placed on the main timeline, because then you know where it is when you need to. Especially handy when you have been doing something else in the meantime (or nothing at all, but it's just a while ago.)
I've read about Flash Mx's #include, and judging from that, I'd say that big pieces of code are best to be put in a seperate .as file. the code will then be added when published, right ?
When the site has to be dynamic (let's face it, it almost always is) let that part work with external .txt files, since they are more easy to update. (for non-flashers the best option)
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.