[Flash]Althorne's Simple Flash Tutorials - #SIMPLE Flash Jukebox# (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


The Illusive Man -> [Flash]Althorne's Simple Flash Tutorials - #SIMPLE Flash Jukebox# (7/14/2007 5:06:36)

Hey, These are my tutorials

Simple Flash Jukebox
Simple Flash Battle Sequence
How To Embed A .swf into a .htm/.html file

The Different Tutorials are in different quotes for neatness.




quote:

Simple Flash Jukebox


Prerequesits
VERY Basic Knowledge of Flash
Flash with AS 2.0 (NOT 3.0) - I believe this is Flash 5 onwards. In CS3, you can turn off AS3 by going "File>Publish Preferences>Click The Flash Tab>Click the Dropdown menu (AS Version>And Choose AS2".

The Tutorial

Ok, this is a very, very simple way to make a flash jukebox. It makes use of loading flash files with embedded .mp3's into it.

Firstly, You open your flash document. Press "Ctrl+j". This opens document properties. I like to use a grey background for design because it is nicer on the eyes. You can have whatever you want (I wouldn't suggest black). I would make the stage 800x600 (widthxheight) because it will run full screen on 800x600 screens and will give you more room to animate. Then save the document as "jukebox.fla" or whatever you want.

Now, Make a button. A simple rectangle will do. Now "Right Click>Convert to symbol". Select button from the drop down menu and call it "tuneButton".

Now, there are 2 courses of action. I will describe both.

a) Name and Label The Buttons.
b) No Labeling.

a) Open the library "Ctrl+l". Right click the tuneButton icon and click duplicate. Do this for as many songs as you intend to have. Then "right click>edit" each duplicate in turn and write in all the text you want. Then drag and drop them all to the stage in any pattern you want.
b) Right click the button that's on the stage (no duplicates here). "right click>copy" then "right click>paste" for as many as you want. If you edit one however, you edit the lot.

Regardless of which path you chose, open a new flash document. Press "Ctrl+j" and set the dimensions to 1x1 (widthxheight). Then "File>Import>Import To Library". Choose the .mp3 you want. Then click on the first frame, open up the properties panel, under sound, select the .mp3 you just imported. Then under Sync, select "Start" and "Loop" from the 2 dropdown boxes. Leave the input box at 1.

Now save this as "tune1.fla" IN THE SAME FOLDER AS YOUR MAIN MOVIE!.

Repeat this process of creating new files for as many songs as you want to use. This number should match the number of buttons.

In the main movie (not the song ones) click on one of the buttons. Add this code to each button (minus the quotes).

"on (release) {
loadMovieNum("[swfname].swf", 1);
}"

Replace [swfname] with the name of the .swf file that holds the .mp3.

Put this code in every button replacing [swfname] for the correct name.

Now, you will have noticed, there is no off button. No matter. Make another rectangle on the stage. "right click it>convert to symbol". Make it a button, and give it the name of "offButton". Press ok. Give it this code (minus the quotes)

"on (release) {
unloadMovieNum(1);
}"

Now, publish the movie, and put it on a webserver. BE SURE TO HAVE ALL THE .SWFS TOGETHER and enjoy sweet music.




quote:

Simple Flash Battle Sequence


Prerequesits
A Basic Knowledge of Flash
Flash with AS 2.0 (NOT 3.0) - I believe this is Flash 5 onwards. In CS3, you can turn off AS3 by going "File>Publish Preferences>Click The Flash Tab>Click the Dropdown menu (AS Version>And Choose AS2".

The Tutorial

Hey,

Reference Notes
I Am Using Flash 8 Pro. This tutorial works in Flash 8 Pro. No Guarantees It Will work in anything other than Flash 8 Pro.
I am writing this straight into the forum window (WITH NO VERSION OF FLASH OPEN AT THE TIME). This is purely from memory and there may be some errors. Please report them to me in a reply.




So, Here We Go.

Firstly, You open your flash document. Press "Ctrl+j". This opens document properties. I like to use a grey background for design because it is nicer on the eyes. You can have whatever you want (I wouldn't suggest black). I would make the stage 800x600 (widthxheight) because it will run full screen on 800x600 screens and will give you more room to animate.

Ok. Now it's time to draw some stuff. It doesn't have to be good. Stickmen are fine. Sorry, pivot doesn't count in this case. It should have a head on 1 layer, a body on another layer. Both arms on different layers (for added sweetness you can make the arm 2 parts so you can more the lower arm seperately and vica versa). You should have 6 layers if you followed the added sweetness path, or 4 if you didn't. Now the legs. 2 legs are fine, but again, for added sweetness you can make the legs into 2 seperate limbs.

Now, on the timeline select all the frames. "Right Click>Cut Frames". The frames should now be empty. Now Click "Insert>New Symbol". Make it a movieclip called player. Click OK. Now find this movieclip in the library "ctrl+l" and "right click>edit". Click on the first frame (and only frame) in the timeline and "right click>paste frames". Your guy should be there.

I take it you can animate, so animate an idle position (knees bending, arms swaying). When you are done, a) (if you tweened). Highlight all the second to last frames, "right click>insert keyframe". Then delete the last frame. Then in your actions layer, or any layer you like, write (in the actions panel) "gotoAndPlay(1);" (minus the quotes). This should loop the sequence.

The frames should still be in the computer's memory, so highlight all the layers in the frame just after the end of the sequence and "right click>paste frames". You can then animate your attack sequence. On the frame BEFORE the frame where your character hits the enemy, create a keyframe in the actions layer (or the layer you use for actions) and write "damage=[base damage - you choose this]+random([Random Damage]);" (Minus the quotes and the '[]s'. They are for you to choose what you put in). This creates the damage variable. Now (in the stage) create a dynamic text box with the VARIABLE NAME, NOT INSTANCE NAME of "damage", and place it on the stage. Make it large enough to hold 2 digits. In the next frame, make a keyframe in the actions layer (and copy over the damage text box) and write in the actions panel //Reduces the Enemy HP By Damage
"_root.enemyhp = _root.enemyhp - damage;)
if(_root.enemyhp<='0'){gotoAndPlay("win");} else {play();}
In the final frame, in your actions layer, write "gotoAndPlay(1); _root.enemy.gotoAndPlay(attack);" (minus the quotes).

That is what makes the enemy hp go down, and if the enemy hp is at 0 hp, turns the playhead to the "you win" frame".

In the root timeline, make 2 dynamic text boxes. Give 1 the VARIABLE NAME playerhp and the other the VARIABLE NAME enemyhp. Make them big enough for 3 figures.

In the library "ctrl+l" find the player movieclip, "right click>duplicate". Give the duplicate the name enemy. Drag player to the left side of the stage. Drag enemy to the right side of the stage. Open the free transform tool, and drag right to left. This makes him attack the player, instead of going the wrong way. Double click the enemy movieclip. Go to the actions for damage (1 frame before he hits) and change the numbers in damage for whatever you want. In the hitting frame, change the Actionscript to this:
"_root.playerhp = _root.playerhp - damage;)
if(_root.playerhp<='0'){gotoAndPlay("lose");} else {play();}
In the final frame, change the Actionscript to "gotoAndPlay(1); _root.menu._visible='true';" (minus the quotes)

Now, go to the root timeline, and click ONCE on player - give him the INSTANCE NAME of player. Click ONCE on enemy - give him the INSTANCE NAME of enemy.

Now make a button on the stage (make a rectangle, "right click>convert to symbol". Select button from the dropdown list. Give it the name of menu. Click ONCE on the button, then open the actions panel. Write this in the actions panel (minus the quotes)
"on(release){_root.player.gotoAndPlay("attack");
_root.menu._visible='false';
}"

Go into the player movieclip. Go to the first frame of the attack sequence. And give the frame the name of attack. Do the same in the enemy movieclip.

In the root timeline, highlight all the frames in the sequence (i gather there is only 1 collumn of them) and drag them forward 1 frame. In the first frame that was created, write the actions of (minus the quotes):
"playerhp='[Your Choice of Player HP];
enemyhp = '[Your Choice of Enemy HP];"

Create a keyframe after the battle sequence. write a "win message". Then, give it the name "win". Create a keyframe afterwards and write a "lose message". Then give it the name "lose" (both, minus the quotes).

In every frame in the ROOT timeline, write the "stop();" action (minus the quotes).





I think that's everything there is to a simple battle sequence. You can expand it to have spells and mana points, but I'm not covering that today.

IF YOU FIND ANY ERRORS, REPORT THEM AND I WILL FIX THEM





quote:

How To Put A Flash Movie In A .htm/.html file



Prerequesits
A Text Editor (I.E. Notepad), but a more advanced program (frontpage/dreamweaver) works too.

The Tutorial

This isn't the big, flashy way. It just works.

Open your text editor. Copy and paste this.

<embed src='Name of Movie.swf' width='Integer' height='integer' quality='low, medium or high'></embed>

This is assuming you already have a .htm with things in it. If not, then go "File>Publish Settings>and have the HTML box ticked. Then click publish." Flash does it all for you.

Change the 'Name of Movie.swf to whatever your movie is called.
Change the 'Integer' to whatever you want the width and height to be. HTML can stretch a flash movie.
Change the 'Low, Medium or High' in the quality section to whatever you want out of those 3. They are the same quality settings as flash.

For this to work, the .swf must be in the same folder. If it is in a SUBFOLDER of the current folder, you have to write subfolder/Name of Movie.swf instead of just Name of Movie.swf





More coming soon

-Althorne




Nicky -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/14/2007 7:13:53)

Nice job Althorne :)

I'll probably use this one day. Pictures would probably help, but it's still understandable without them ^_^

Also, thanks for noting that ActionScript 3 will not work with your script. At the start of learning how to use my deadly simple actionscript I used 3.0 and got so frustrated from the most straightforward tutorials not working xD.

Good job, keep it up!




CL3 -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/14/2007 9:23:26)

Nice, i dont have time to compare it myself but is this script different from the old DD system? Im guessing that this at least evolved from the old script amiright lol.




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/14/2007 11:49:21)

It has evolved in some ways, and has not in others. the DD script used a hp bar system, this does not. This involves other subtle differences. And the new DD script is in development (starting in a few months). It will be good.

It will evolve more later.




Also, if there's anything anyone else wants to see, i'll do my best to do it. I may make some php tutorials as well




flsg -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/14/2007 13:15:53)

well I don't know if this tutorial is for beginner or medium flash user, but if you're good and want to create a really big game, you should compress ALL the above frames into one single frame(like what I did in bubble's adventure, if anyone remember it anymore XD)
by analyzing AQ and DF's battle system, I'm almost 100% sure that the losing, winning and the normal battle system is on the same frame




Rain -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/14/2007 15:30:35)

This thread doesn't help at all.
Everything you just posted was common sense.
Maybe try to give out some really big secret? xD Like I could make a tut on how to make objects follow the mouse with delay...




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/15/2007 3:46:51)

Rain, I know it's all common sense.

However, I see people's pleas for a simple battle system tutorial. I'm making a more advanced one now, but I believe this helps our newest flash users




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/15/2007 10:05:41)

Updated

2 New Tutorials.

1) Simple Flash Jukebox
2) How To Embed A Flash File Into A .htm




somebody621 -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/15/2007 13:14:50)

Rain: Even if it is simple, it still helps some people. I haven't seen you writing tutorials on flash. Also, there are no "secrets" to flash. It's just in how you write the code.

Althorne: if you want, I can help with code or with AS3. For your tutorials, I would advise to not use actual copy and paste code because that doesn't help one learn much, but actually explain some of the code.

Edit: for the htm, for some reason, if you set a property "wmode" to opaque, you get MUCH better fps. However, screenreaders won't be able to read text. ;(




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/15/2007 13:22:44)

I've commented it as best I can (with the text preceeding and following)

If you mean the htm, it's just a simple embed command. No need for too much explaining.

And about AS3... It's fairly new. And AS2 is easier to work with in my opinion.




flsg -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/15/2007 15:01:53)

somebody621: cool you're learning as3 too?[:)]
I like as3's professional OOP style, it gives me the look of a real pro XD




Nicky -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/15/2007 21:55:22)

Very nice, more tutorials!

Maybe a preview of what it should look like in the end would be a good idea.

Quoting the tutorials looks nice, nice idea :)




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/16/2007 2:56:02)

I'll add resourse .swfs. I'm waiting on a site though.




Nicky -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/16/2007 4:15:30)

Awesome. Sounds good.
Otherwise, they all look great ^_^




dominic_r_monroe -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/16/2007 16:26:00)

gl on your dictionary nice tuts




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/17/2007 3:35:18)

Cheers, anyone want to see a tutorial here, i've run out of ideas




dominic_r_monroe -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/17/2007 3:52:54)

simple animation ??




flsg -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/17/2007 9:35:01)

althorne: I finally read a little bit the tutorial(sorry I was too lazy XD)
why do you use load/unloadMovieNum instead of load/unloadMovie? Especially for unloadMovieNum, you will unload everything on the first depth if you do so, so why don't you just use mcName.unloadMovie()?




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/17/2007 14:45:52)

I'm not loading it into a movieclip. I'm loading it straight into the timeline.




flsg -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/17/2007 16:27:31)

who said loading into movieClip? Beside, EVEN if it DOES load in a mc, _root is considered as a mc




The Illusive Man -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/19/2007 6:12:24)

Oh, i don't know then. It just worked i suppose :)




DeathKnight2 -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/19/2007 8:29:14)

I would try it if I had flash [:(] looks nice anyways




VampireHSS -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/19/2007 15:57:04)

Great tutorials. I will be sure to try at least the jukebox.




Phrase -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/19/2007 16:26:43)

Thank you, THANK YOU! for the jukebox one.




flsg -> RE: [Flash]Althorne's Flash Tutorials - #Flash Battle Sequence# (7/19/2007 18:37:59)

hey, it was a jukebox?! sorry I didn't pay attention[>:]
and here's a simpler way: flash component has itself a jukebox component, so just drag one on the stage lol




Page: [1] 2   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.140625