Announcement

User registrations are currently disabled due to high spam traffic.

#1 23/06/08 7:33am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Basic LiveSwif Classes

nothing's Classroom- Basic LiveSwif
================================

Okay, I know many of you need help with LiveSwif for making games, so, my response is to bring you all up.

Questions to be answered:
How do I make buttons?
How do I make level codes?
How do I make an HP bar?
How do I make a sprite move? Completed
What is this timeline thing? Completed
How do I make multiple levels withought it freaking out and going back to the first frame? Completed
How do I use external images? Completed

Chapter One: The Workspace, and Basic Codes.
Look up and see the big bar with a green line, and numbers? This is the timeline, and the numbers are the frames.
Now, the white space is called the stage, and that is where you "build" your game.
The Actions panel is where you put in actionscript (Now called AS)
the Library hold EVER image in the game.

Q: How do I add an image to the stage from the library?
A: Drag the icon in the library to the stage.

Q: How do I make a sprite/charcter?
A: Go to Insert -> Sprite.

Q: Did that, and woah, what happened to the "stage"?
A: Now, you are in drawing mode. Draw or paste your character in here. Now click the little tab that says "Scene 1" on it to go back to the stage.

Q: I pasted a picture of mario in there, but when I put a background on the stage, he has a white box. How does i getz rid of it?
A: Download Photofiltre (Link at the end) and make a new picture (File -> New). Now paste the picture of mario in there. click the checkered button with a man on it towards the top. it says something about 256 colors at max. Click ok, then okay again, now save as a .gif or a .png. Now just put it into LiveSwif.

Q: Great, looks good. How do I make him move?
A: Click on him and in the dropdown box in the Actions Panel, select onClipEvent(enterFrame)
Type  (Just copy...smile):

if(Key.isDown(Key.UP)){
    _y-= 10;
}
if(Key.isDown(Key.DOWN)){
   _y+= 10;
}
if(Key.isDown(Key.LEFT)){
   _x-= 10;
}
if(Key.isDown(Key.RIGHT)){
  _x+= 10;
}

Great. Now, you probably have by now a background and stuff. Hit F12 to preview. Move him with teh arrow keys. Hmmmm.....that's weird. He stays in the same, and his sprites don't change! Don't worry, I'm working on figuring this out too. I think I have it down though. But, you don't learn it now! MWAHHAHAHAHAHA! Okay. How does he jump?
copy and paste fellow:
onClipEvent(enterFrame)

++gravity;
      _y += gravity;
      if (Key.isDown(Key.LEFT)) {
        _x -= speed;
      }
      if (Key.isDown(Key.RIGHT)) {
        _x += speed;
      }
      if (this.hitTest(_root.ground)) {
        _root.player.isJump = false;
        _root.player.gravity = 0;
        --_root.player._y;
      }
      if(this.hitTest(_root.platform)) {
       _root.player.isJump = false;
       _root.player.gravity = 0;
       --_root.player._y;
      }

onClipEvent(mouseDown)

if (Key.isDown && isJump == false) {
        isJump = true;
        _y -= 5;
        gravity = -9;
      }

onClipEvent(load)

gravity = 5;
      speed = 10;
      isJump = true;

Hey jfig111, if that looks familiar, it's what I use in all my engines, and what you used in Moovlin 1! Lol, this is your credit.

Alright, F12 it.

Q:MARIO FALLS OF TEH SCREEN! :cries:
A:...not much of a question, BUT, make a new sprite and put the floor that you undoubtly stole w/o credit from a sprite sheet. Now click the little tab that says "Scene 1" on it to go back to the stage.

Q: He still falls!
A: Not done yet. See the little box that says instance name? Click on mario, and go to that box. Now type "player" in it. Do the same for the ground sprite, and type "ground". Neither with quotes, or caps. NOW F12 it.

Q: Yes, you are teh awesome! He moves when i tell him to, and he jumps too.
So, I saw in the code "platform"?
A: Ah yes, the main part of a platform game. Well, can you figure it out? Probably not. Make a new sprite and put some blocks in there or something. Get back to the stage, and drag it on. Give it the instance name of platform. F12.

Q: Cool, a level! Now, I already put the goal sign in, made it a sprite, and made it's instance name "goal" because you taught me well. What now?
A: Well, put in this code:
onClipEvent(enterFrame)

if(this.hitTest(_root.player)){
   gotoAndPlay(2);
}

Make a level on frame two. on when the action panel dropdown says On Frame, just type "stop();" withought quotes. MEMORIZE THIS, and do the same to the first frame. This stops the frame, because if you were too impatiant and made the level and F12'd it already, you noticed it was screwed up. Yep. Now try it.
Amazing, huh?

Note, when adding platforms, copy and change the code for your sprite, and make sure that the diferent platforms have different names.
Ex.

if (this.hitTest(_root.ground)) {
        _root.player.isJump = false;
        _root.player.gravity = 0;
        --_root.player._y;
      }
      if (this.hitTest(_root.ground2)) {
        _root.player.isJump = false;
        _root.player.gravity = 0;
         --_root.player._y;
       
      }
       if (this.hitTest(_root.ground2)) {
        _root.player.isJump = false;
        _root.player.gravity = 0;
         this._y -= 120;
       
      }
        if (this.hitTest(_root.ground3)) {
        _root.player.isJump = false;
        _root.player.gravity = 0;
         --_root.player._y;
       
      }

If this confuses you, download the Moovlin source and study it like a textbook. It for now is your holy grail.

Q: Sweet! Now, how do I make a main menu and code flash DOOM and code flash HALO and code linerider and code tactical assasin--
A: stop(); there! Tactical Assasin....sounds good for my button and cursor tutorial. Next edit! Enjoy! I hope this helps.

Downloads-
http://resiststorage.org/images/story2519.lmv Moovlin Source
http://www.download.com/Liveswif/3000-2 … 02699.html LiveSwif
http://photofiltre.en.softonic.com/ Photofiltre- Free graphics program, I use it, and Photoshop 7.

I promise, any downloads I give you will be safe, and free.

Hope you enjoyed, and your welcome!

Don't be afraid to ask me questions, and use that source code and any other source/engines i give you like textbooks. Don't forget to bring them to class.

~nothing //<- He is an awesome guy. Also, this is how to add comments in AS.

Last edited by nothing (23/06/08 7:37am)


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#2 23/06/08 8:33am

JaXeRiR
Elite Moderator
From: Teh Interwebz
Registered: 25/03/07
Posts: 1925
Website

Re: Basic LiveSwif Classes

Sweet, a helpful topic. I really enjoyed reading through it, even though I don't have the knowledge or the skills to do anything like this.


[url=http://profile.mygamercard.net/JaX3RiR][img]http://card.mygamercard.net/nxe/JaX3RiR.png[/img][/url]

Offline

 

#3 23/06/08 8:36am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

How far did you get before you got lost? I barely understand the coding by itself, I'm just memorizing bits and pieces of flash. Works pretty good for me. If you read through it carefuly and follow along, I'm sure you'll have what I talked about in no time.


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#4 25/06/08 6:03pm

Dezerith
Moderator of Doom.
Registered: 27/07/07
Posts: 196
Website

Re: Basic LiveSwif Classes

Code:

if(this.hitTest(_root.player)){
   gotoAndPlay(2);
}

should be..

Code:

if(this.hitTest(_root.player)){
   _root.gotoAndPlay(2);
}

[img]http://i26.tinypic.com/28iys08.jpg[/img]
[img]http://www.resiststorage.org/images/blazebytedev53.png[/img]
[img]http://www.resiststorage.org/images/PSPflashForDezBzeByteDev4.png[/img]

Offline

 

#5 26/06/08 2:31pm

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

Oh, you're right! Oops. I wrote it at like 3am so of course I'd mess up. I expected more replies though, like desperate thank yous and cries for the next chapter...hmmm. So did any new flasher use this?


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#6 26/06/08 5:09pm

Zuriki
Flash Dev (The Lazy One)
From: Manchester
Registered: 18/01/08
Posts: 755
Website

Re: Basic LiveSwif Classes

Well I didn't read through because I didn't find it necessary.

But it looks long so *claps*


[img]http://img134.imageshack.us/img134/9129/headerxt2.png[/img]
[url=http://zuriki.co.nr/project/traveller/][img]http://i28.tinypic.com/2vspafo.png[/img][/url]
[url=http://zuriki.co.nr]Zuriki - PSP Flash Games[/url]

Offline

 

#7 26/06/08 5:51pm

69corvette
That one guy.
From: Not Palmdale, CA
Registered: 01/02/08
Posts: 280

Re: Basic LiveSwif Classes

yeah, I dont need it either, but I skimmed through it and it looks like it would be helpfull to a flash noob. good job  big_smile.


[img]http://img221.imageshack.us/img221/8990/smallersigcopylb1.jpg[/img]

Offline

 

#8 27/06/08 5:37am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

Thanks guys. I'm writing chapter 2 now.


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#9 27/06/08 5:52am

rollinroll
Moderator
Registered: 23/10/06
Posts: 1890

Re: Basic LiveSwif Classes

I've stickied it smile

Offline

 

#10 27/06/08 5:57am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

YES!!!!! My first sticky!!!!!!


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#11 12/07/08 6:41pm

lilmb
Serious Addict
From: Latvia
Registered: 22/06/08
Posts: 305

Re: Basic LiveSwif Classes

So, when the health bar thing will be completed?

Offline

 

#12 12/07/08 9:31pm

Scruffy15
Anti-Christ
From: Facing The Plastic
Registered: 07/01/08
Posts: 871

Re: Basic LiveSwif Classes

I WILL USE THIS CODING AND MAKE SOMETHING RETAR|)ED!!!! smile


I'm Infinite.

Offline

 

#13 20/07/08 4:10pm

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

I have a lot I'm working on now, so the next chapter will be done soon, but please be patient. Health bar and buttons next tutorial.


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#14 28/07/08 8:38pm

Breakeraj
Addict
Registered: 19/02/08
Posts: 240

Re: Basic LiveSwif Classes

Can you help me?
Im making a game and I'm stuck...I have a few movie clips.One is an attack clip which is a sword.Another is a clip with an enemy called evil.The last one is a player called player.Please give me codes to attack the enemy with the up key. I want the enemy to die when it touches the attack clip. Please help!

Offline

 

#15 29/07/08 4:12pm

joker
Lord o' Pancakes
From: Wyoming, Wisconsin, U.S.A.
Registered: 02/07/08
Posts: 1337
Website

Re: Basic LiveSwif Classes

i dont understandz?! do i need flash fo deez? i want to meek ay geem toow  i wiill meek a silly geem? plz hewlp badger


[b]OBEY[/b]


MINECRAFT. Hit me up if you wanna play [:

Offline

 

#16 30/07/08 3:29am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

Breakeraj wrote:

Can you help me?
Im making a game and I'm stuck...I have a few movie clips.One is an attack clip which is a sword.Another is a clip with an enemy called evil.The last one is a player called player.Please give me codes to attack the enemy with the up key. I want the enemy to die when it touches the attack clip. Please help!

Alrighty then. On your player MC, drag the attack clip (the sword) on to frame 2 or 4 or 6 or whatever. Lets call it frame x. Now, on the player type the movement code and so on. Next, follow along:

Code:

if(Key.isDown(Key.UP)){
  gotoAndPlay(frame x);
}

Now, go back into the player, and click on the sword. Give it an instance name of "sword" without quotes. Then drag the player and enemy onto the screen. Then, instance name the enemy "enemy", withought quotes. Make sure that there is an empy frame on frame 2 of the enemy with a stop(); command. THEN, go back into the player and put this on the sword:

Code:

if(this.hitTest(_root.enemy)){
  _root.enemy.gotoAndStop(2);
}

There you go!


For above, please repost in ENGLISH so I can help you...:\


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#17 30/07/08 3:24pm

joker
Lord o' Pancakes
From: Wyoming, Wisconsin, U.S.A.
Registered: 02/07/08
Posts: 1337
Website

Re: Basic LiveSwif Classes

do i need flash for this lol and the rest is nonsense


[b]OBEY[/b]


MINECRAFT. Hit me up if you wanna play [:

Offline

 

#18 30/07/08 8:01pm

lilmb
Serious Addict
From: Latvia
Registered: 22/06/08
Posts: 305

Re: Basic LiveSwif Classes

cowwer6 wrote:

do i need flash for this lol and the rest is nonsense

Wow, man. You have posted many posts in this forum, but don't know even basics about flash! No offense man, but when I registered I knew something about this, you can even find my first post in which i introduced me and Nothing suggested me to check out this post about Liveswif!

Offline

 

#19 30/07/08 8:50pm

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

Liveswif. Read the title much?


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#20 31/07/08 3:28am

joker
Lord o' Pancakes
From: Wyoming, Wisconsin, U.S.A.
Registered: 02/07/08
Posts: 1337
Website

Re: Basic LiveSwif Classes

lilmb wrote:

Wow, man. You have posted many posts in this forum, but don't know even basics about flash! No offense man, but when I registered I knew something about this, you can even find my first post in which i introduced me and Nothing suggested me to check out this post about Liveswif!

wow im not fortunate enuf to be blessed with flash. and yea i dont know anything about flash exept how to animate plus i am dislecix and cant code well. yet i can read not code tho 2 muny letrs and numbers


[b]OBEY[/b]


MINECRAFT. Hit me up if you wanna play [:

Offline

 

#21 31/07/08 3:42am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

That sucks.


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#22 31/07/08 3:47am

joker
Lord o' Pancakes
From: Wyoming, Wisconsin, U.S.A.
Registered: 02/07/08
Posts: 1337
Website

Re: Basic LiveSwif Classes

ya i know i ilegaly dwnloded flash and micrsoft confiscated and sent me an email explaneng why jhey did it lol


[b]OBEY[/b]


MINECRAFT. Hit me up if you wanna play [:

Offline

 

#23 31/07/08 5:16am

nothing
Moderator
Registered: 21/03/08
Posts: 389

Re: Basic LiveSwif Classes

No, I meant about being dyslexic


[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]

I'm starting p22 again.

Offline

 

#24 31/07/08 1:35pm

joker
Lord o' Pancakes
From: Wyoming, Wisconsin, U.S.A.
Registered: 02/07/08
Posts: 1337
Website

Re: Basic LiveSwif Classes

ya its not too bad tho only with codes lol


[b]OBEY[/b]


MINECRAFT. Hit me up if you wanna play [:

Offline

 

#25 31/07/08 10:44pm

joker
Lord o' Pancakes
From: Wyoming, Wisconsin, U.S.A.
Registered: 02/07/08
Posts: 1337
Website

Re: Basic LiveSwif Classes

cowwer6 wrote:

wow im not fortunate enuf to be blessed with flash. and yea i dont know anything about flash exept how to animate plus i am dislecix and cant code well. yet i can read not code tho 2 muny letrs and numbers

I found a program i can use called Game Maker and i don't need to be able to code big_smile I'm so happy!!!!!!!!!!!!!!!!!!!!!!!111111!!!!!!!!!!!!!!!!!!!!!!!!1111!1!1!!1!1!!!!!!!!!!!!!!!


[b]OBEY[/b]


MINECRAFT. Hit me up if you wanna play [:

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson