View Full Version : Programming in the Timeline
Holmesc
September 26th, 2006, 09:06 PM
Hello everybody! I recently learned that in Flash 9, you will no longer be able to give script to MC's :cantlook:*gasp. This would greatly affect my ability to... well, any programming whatsoever. If anyone would be interested in giving tips etc. (even a tutorial?) that would be really helpful for me, and probably other people too!
nathan99
September 26th, 2006, 10:07 PM
It's basically the same..
http://www.n99creations.com/?pID=tutorials&col=Blue&tut=basics_of_actionscript_for_flash&p=30&l=Flash_MX_04
evildrummer
September 27th, 2006, 08:53 AM
when I started I was confused but its really easy actually,
Instead of this on the MC "next_btn":
on(release) {
_root.gotoAndPlay(2);
}
it would be this on the main timeline where the button's instance name is next_btn:
_root.next_btn.onRelease = function () {
_root.gotoAndPlay(2);
};
Sinister Rouge
September 27th, 2006, 09:14 AM
when I started I was confused but its really easy actually,
Instead of this on the MC "next_btn":
on(release) {
_root.gotoAndPlay(2);
}
it would be this on the main timeline where the button's instance name is next_btn:
_root.next_btn.onRelease = function () {
_root.gotoAndPlay(2);
};
This really is how you should be scripting in AS2 anyway. The first rule is to keep all of your code centralized on the main timeline and not place it on buttons and graphics.
evildrummer
September 27th, 2006, 11:38 AM
It helps alot as you dont have to go looking for where the errors are. You can just open up the imelines action panel
Holmesc
September 28th, 2006, 12:23 AM
Ok, thanks y'all. I did hear that it was generally regarded as better to program in the timeline so that was one of my reasons.
evildrummer
September 29th, 2006, 01:50 PM
Worked out how to do it?
Holmesc
September 30th, 2006, 09:08 PM
Yeah, pretty much. Nathan's tutorial helped a lot, and along with some experimentation, I think I pretty much have it all down now. In response to Sinister Rogue, I have heard that timeline programming is more efficeint, another reason for me to ask the original question.
REEFˇ
September 30th, 2006, 09:15 PM
Yeah, for some reason I've quit the habit of putting code on symbols, it makes my code so much easier to find & looks much more professional.
If you had this on a movieclip w/ instance name of myMovieclip:
onClipEvent (load) {
a = 0;
}
onClipEvent (enterFrame) {
a++;
}You can put this on the timeline instead:
myMovieclip.a = 0;
myMoveclip.onEnterFrame = function () {
this.a++;
}Fun, eh?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.