yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Flash Actionscript Tutorial 2 - If Statements


2m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

Hey guys, this is Maaz1. Today I'm going to be doing a flash action script tutorial number two. It's a follow-up of tutorial number one.

So I'm going to be teaching you how to make a button to toggle playing and pausing for an animation. This is going to be one button, unlike the first tutorial, which had two buttons.

First of all, you're going to want to make a button. Make a new layer. On the new layer, draw a button, select it, and convert it to a symbol. The type should be button, registration should be center.

What you want to do is go into properties. Right? I'm going to name my button "toggle button." Then you're going to want to open up the actions of the layer. Do this by right-clicking on the frame.

You're going to want to set up a variable: var u Boolean = true. The Boolean type of variable means true or false. So then, you're going to put the if statement inside of an on release.

You're going to do toggle button on release = function() {. Open the curly brace. Then you're going to do if Fu, which implies if Fu equals true. But you don't have to; you can omit that.

Then root.stop(), and then root.Fu = false. So, what "root" means is that it goes—the root is the main timeline, which is what you're looking at right here. If it's inside of a button or a movie clip, you want to specify root so that it does it from the main timeline and not from the movie clip or button.

So then you want to do else {. Open the curly brace. root.play(), and root.Fu = true.

So now, if we test this, we press the button, and it pauses. Then we can press the button again, and it plays.

So, thanks for watching! M cu one, subscribe and goodbye!

More Articles

View All
Why I’m leaving Ally Bank
What’s up, you guys? It’s Graham here. So, first of all, I just want to say I apologize. I am very sorry. I really don’t know what to say because I junked it. If you haven’t seen my video I posted just a few days ago on the best savings accounts to get, h…
Isotopes | Atomic structure and properties | AP Chemistry | Khan Academy
In other videos, we have talked about that the type of element that we are dealing with is defined by the number of protons in an atom’s nucleus. So for example, any atom with exactly one proton in its nucleus is by definition hydrogen. Any atom with six …
This Is Only Red
Happy New Year, Vsauce! Michael here. And in honor of 2013, let’s discuss 13 things. To begin, where to spend all that cash you picked up over the holidays? Now, plenty of websites sell cool stuff. United Nuclear sells Aerogel, radioactive isotopes, jet …
The Wonders of Urban Wildlife | Podcast | Overheard at National Geographic
So I’m a solo hiker. I prefer to hike alone, and I’m a meanderer, so I have no idea where I’m going. It’s July 2021, and I’m meandering with Danielle Lee, a biology professor at Southern Illinois University Edwardsville. We are in our neighborhood in Nort…
Are we about to see a DROP in Real Estate Prices?
What’s up you guys? It’s Graham here. So, it’s no surprise the economy is doing better; stocks are higher than ever, and real estate has been going up steadily since 2011. It’s also no surprise that much of that recent momentum was largely fueled by extre…
Regrouping with decimals
We are told to fill in the table with whole numbers to make ten point seven four in two different ways. So, pause this video and see if you can figure that out. So, we really need to fill out what would be what would you put in here for this to be a repr…