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
|
|
|
|