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

Basic Movment in Flash


2m read
·Nov 3, 2024

Processing might take a few minutes. Refresh later.

Hey guys, this is mackheads101 and today I'm going to be, uh, well we got a special guest and he's going to be showing you some action script. So, um, here we go.

Okay, so first of all I'm going to open up Flash. I'm going to be using Action Script 2 because I'm, uh, I'm not familiar with Action Script 3.

Um, for in this tutorial, I'm going to teach you how to move an object with, um, with your the arrow keys. I'm going to convert this to a symbol, name it box. Then I'm going to open up the actions, or you can press F9, and um, I'm going to write uh, on clip event and then I'm going to write a, uh, an ellipse and write enter frame, which means it will do this every time, uh, every time, every 12 times per second because of the frames per second.

Then I'm going to write if, if, and if the things inside the ellipses are true, if key period is down, key period left. Then I'm gonna write a bracket, a scrolly bracket thing, I'm writing a close bracket.

So to close the um, the if key equals is down left, I'm going to write x, meaning the x of the box plus, oops, plus equals 10. Now if we test this, uh, there'll be a command enter. What it should do, oops, I forgot a, uh, thing there. What it should do is it should move in, uh, one direction.

Now, I didn't do this correctly so I'm gonna have to change the plus to a minus so that it goes in the correct direction. So when I go with this key, it goes here. Now I'm gonna copy to make the other one. I'm going to copy this, I'm going to paste that here and write if and change the left here to a right with all caps.

I'm just going to change the minus to a plus and then if I command enter, I'll test it and I can move in both directions. Now for up and down, I'm going to paste this here and change the right to up and then change the x to a y and then minus equals 10.

Now if I command enter and test this, I can move in three directions: up, down, left, and right. And lastly, for the for down, I'll just copy paste that here, change the up to a down and change the minus to a plus.

Now I'll just test that and I can move in all four directions and, uh, and that's al...

More Articles

View All
5 Things to Know About the Warming Arctic | Before the Flood
If you look at it from space, the top of the world, the white ice acts like a reflector, like a mirror that sends back sunlight and energy and heat back to space. That’s what made the Arctic the cooling system of the planet. I was walking with Leo on the…
What to do the night before an exam: 3 tips from Sal Khan
Here are my three tips to reducing stress the night before a test. Tip one, stay physically healthy. There’s a tendency that the night before you wanna cram; you wanna stay up late. You’re stressed, you’re anxious. That’s the exact wrong thing to do. The…
Predator prey cycle | Ecology | Khan Academy
What I want to do in this video is think about how different populations that share the same ecosystem can interact with each other and actually provide a feedback loop on each other. There are many cases of this, but the most cited general example is the…
Diego Saez Gil - How Pachama Uses Tech to Solve Climate Change
Alright guys, welcome to the podcast! How’s it going to you? It’s going great. So today we have Diego Sayis Gil of Pochamma from the Winter ‘19 batch and Gustav Helstrom, who is a partner at YC. So today we’re here to talk about Diego’s company. Gustav, w…
Worked example: Determining the effect of temperature on thermodynamic favorability | Khan Academy
Let’s do a worked example where we calculate the standard change in free energy, ΔG⁰, for a chemical reaction. For our reaction, let’s look at the synthesis of ammonia gas from nitrogen gas and hydrogen gas at 25 degrees Celsius. ΔH⁰ for this reaction is…
Experiments in Art and Technology with Artforum Editor Michelle Kuo
So I’ll just start by saying experiments in art and technology was a group that was founded in 1966 by the artist Robert Rauschenberg by an engineer named Billy Kluever, who was a research scientist at Bell Labs at that time. Literally, the heyday, or bas…