Clovis15 Preschool Spritan Lv 2


Number of posts: 258 Age: 31 YouTube Username: ultrapub NewGrounds Username: clovis15 DeviantArt Username: clovis15 Registration date: 2011-01-16
 | Subject: Our Friends, the Flags! Sun Nov 20, 2011 1:45 am | |
| ( NOTE: The following may only apply to AS2, although I think the code I use here is universal to later versions also) A while back I noticed some people telling people they could use the gotoAndPlay(); command to effect jumping around a film. While this is true, the disturbing part is that they were suggesting people input straight frame numbers when you use this. So long as you're only going to first frame of a scene, this isn't entirely whack advice. After all, frame 1 of a scene is always going to be the first frame. However, what if you want to go some other frame in a scene... what then? If you ever go back and edit any of the animation in that scene - perhaps because you were unhappy with it, or maybe just felt like being difficult to yourself - then suddenly every gotoAndPlay(); command could potentially be pointing to the wrong frames and all have to be fixed by hand. Sure, you could wait to program stuff like this until the entire movie was done, but some kinds of interactive content can't even be tested without the jumping functionality already in place. You'd be a somewhat poor animator if you didn't look anything over even once until the 11th hour! Are you doomed to suffer the yoke of never modifying anything so that the links don't break, or fixing them all by hand each and every time you modify something? NO! NEVER FEAR, FOR OUR FRIENDS THE FLAGS ARE HERE! Yes, that's me running Flash 6 on a Windows 7 machine... just ignore that fact...Anyways, as indicated by circle 1, you may notice that various frames have a flag on them with a name next to it. No, this doesn't mean that I've found a way to play minesweeper inside of flash, although that would be an interesting thing to try and do. It actually means that there is a way to break free of the shackles of having to use specific frame numbers when I use the gotoAndPlay(); command. When you have a frame selected on the time line, and have the properties panel open, you can find an option - as shown by circle 2 - to give that frame a name. Don't worry, even your much newer - less ghettofied - versions of Flash will also have this highly useful feature. When you input a name down here, that frame up above will be flagged in the timeline with a flag of the same name. From now on you may reference that frame by the flag's name, rather than the frame number itself, and all references done this way will remain valid no matter how much you juggle things around. If I were to, using the example above, type out the command: gotoAndPlay("window2"); then it would always go to the right frame, whether that was frame 42 or frame 1337. If I wanted to got to a flagged frame in a diifferent scene, then I'd just use gotoAndPlay("scene_name", "flag_name"); and I'd still get the desired result. Remember, you must now use quotations marks in the command as you're using a reference title for the frame instead of the actual number itself. I may not often animate; but when I do, I use sprites... Stay pixelated, my friends!PREVIOUS TUTORIALS:Clovis15 Tutorial-1: Easy Dynamic Sound Control With ResumeClovis15 Tutorial-2: How to Live Life Without V-CamClovis15 Tutorial-3: Dynamic Animation, and Subtitle Toggles
Last edited by Clovis15 on Mon Nov 21, 2011 12:58 am; edited 1 time in total |
|
Patt Administrator


Number of posts: 12910 Age: 17 NewGrounds Username: Pattiasina24 DeviantArt Username: Pattiasina24 Registration date: 2009-03-28
 | Subject: Re: Our Friends, the Flags! Sun Nov 20, 2011 1:53 am | |
| Oooh, that is nice, I never though of doing it in that way. : o ____________________________________________  [The Return] |
|
Clovis15 Preschool Spritan Lv 2


Number of posts: 258 Age: 31 YouTube Username: ultrapub NewGrounds Username: clovis15 DeviantArt Username: clovis15 Registration date: 2011-01-16
 | Subject: Re: Our Friends, the Flags! Sun Nov 20, 2011 2:02 am | |
| NOTE: Before anyone asks, Frame 2 is actually labelled Buttons. There just wasn't enough room on the timeline to show the full name. |
|
Patt Administrator


Number of posts: 12910 Age: 17 NewGrounds Username: Pattiasina24 DeviantArt Username: Pattiasina24 Registration date: 2009-03-28
 | Subject: Re: Our Friends, the Flags! Sun Nov 20, 2011 2:03 am | |
| No dude that is definitely named butt, you dirty man you. ____________________________________________  [The Return] |
|
Leo Competition mod


Number of posts: 7638 Age: 15 Location: Brazil YouTube Username: leocartoon1 NewGrounds Username: leocartoon1 DeviantArt Username: leocartoon1YT Registration date: 2009-05-23
 | Subject: Re: Our Friends, the Flags! Sun Nov 20, 2011 5:18 am | |
| ^ lol
Well I knew about these already, they are mentioned in various tutorials and Flash books I had.
But nice tutorial, man. Your tutorials are always clear and straightforward. ____________________________________________ sketchbook - tumblr - deviantART | Sieghart wrote: | Gates to Infinity was literally released very recently and is also a mystery dungeon game It says the word "Height". idc if height means length to you, where I come from height means height, this is a forum, this is a forum post, you have boobs. because worrying about them keeping bug sizes accurate is totally important in a fictional game about satan worshiping animals fighting each other to the death because they were enslaved by their human overlords |
|
|
Ping Super Spritan


Number of posts: 19709 Age: 17 Location: Madison Wisconsin YouTube Username: TheRealDealAnimator NewGrounds Username: TheRealDealArt DeviantArt Username: TheRealDealArtist Registration date: 2010-09-15
 | Subject: Re: Our Friends, the Flags! Thu Dec 01, 2011 1:12 pm | |
| Happy day, Clovis. Thank you. |
|