-
What's with buttons?!?
Could someone explain to me what's the point of even considering using buttons over movieclips. With the movieclip you can incorporate the same functionality.
For a button it's this: on (press) {
For a movieclip it's this: onPress = function(){
The only reason I can see for it's existence is for newbies because of the lessened code requirement. Other then that I don't see any advantage.
-
Registered User
hi,
I agree with you. When I have to create something more complex, using ActionScript, I always use Movie Clips.
For example, using a Movie Clip, I can maintain a "down" state.
But, Buttons are great for simple tasks and simple animation, as they have the 3 states predifined, and you don't need to create your own code to control them.
Notice that using on (something) VS onSomething() is not really a difference. It's not true. You can use both in each case.
The thing is on (something) is attached to the Object (Button or Movie Clip) - Flash 5 style - while onSomething() is attached to the timeline - Flash MX style.
Take into account that using methods onSomething() is considered a better practice. You don't have to spread code all over your Objects. You can have all the code attached to a timeline.
Last edited by nunomira; 02-23-2007 at 10:01 AM.
-
OOP is one letter from OOPS
Well Buttons are simple templates with 4 defined states (3 visible). If you do this with a movieclip, you have to handle the states. Also, a button acts like it is on the same level, so lets say we have one button and one movieclip on the main time line.
Button:
on(release){
gotoAndStop(5)
}
will cause the main timeline to go to frame 5.
Movie Clip:
on(release){
gotoAndStop(5)
}
would cause that movieclip to go to frame 5. to do the root, you would have to:
Movie Clip:
on(release){
_parent.gotoAndStop(5)
//or
_root.gotoAndStop(5);
}
So the short answer is buttons are just a simple control mechanism, movieclips require a bit more work.
-
I guess that shows about how much my usage of templates has been. In other words, I don't really use templates or buttons. Can anyone blame me for seeing button usage as a newbie thing?
-
OOP is one letter from OOPS
Do what ever you are comfortable with.
-
Registered User
It's not exactly a newbies thing.
Buttons and Movie Clips have their own use. Why would I waste time doing something with a Movie Clip when only a Button is required?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|