STORY LOOP FURRY PORN GAMES C SERVICES [?] [R] RND POPULAR | Archived flashes: 229672 |
/disc/ · /res/ — /show/ · /fap/ · /gg/ · /swf/ | P0001 · P2596 · P5191 |
This is the info page for Flash #71544 |
2 |
Flash CS3 Mini-Tutorial |
0% |
l |
lo |
loa |
load |
loadi |
loadin |
loading |
Flash CS3 Mini Tutorial 2.5 |
By: Jaye19 |
enter |
Done |
Flash Cs3 Mini-tutorial 2 |
Just another mini-tutorial that I made in my spare time while making my BIG tutorial so just look, learn and enjoy! |
Back / Next |
Main: |
Making Buttons Timer Drag & Drop Right Click Menu |
You have to press the next and back buttons to see the whole tut and if the buttons dont work right click and click it |
Making Buttons |
In flash CS3 making buttons is more complicated that in flash 8 so to start make a new flash AS3 document to start and make new button (ctrl+f8) then you will be taken inside an empty button |
Main |
Now, when you are inside the button look above the screen 4 tabs are there right? Now look at the parts (below) to know there meaning |
up - The look of our button without any mouse detection over-The look of your button with mouse detection down-when you click it hit-the hit area of your button (it's invisible) |
Now that you know the parts and have put some desgns in them now it's time to put some actions so go to scene (1t can be seen above your workspace) then press f9 now as you can see when the button is highlighted inside the actions panel it says you cannot put some actions now that one of the things that are complicated in making buttons in as3 now continue to the next page |
Now click your button find instance name and put there my_btn (used as refference for the code) Now make sure that the action panel is open if not so press f9 then click on the frame you are in then insert the following actions |
stop(); //stops the main timeline function button(evt:MouseEvent):void { nextFrame(); //opens a new function and when the fuction is functioned it will go to the next frame } my_btn.addEventListener(MouseEvent.CLICK, button); //gets your button by the instance name and when it it clicked it opens the function does it |
Now beside your frame make a blank one and put anything there to know which frame you are and put a stop(); action inside it then press ctrl+enter to test your movie now when you click your button it goes to the next frame awesome right! now there are tones of thing that you can change in your code see the next page |
stop(); //stops the main timeline function button(evt:MouseEvent):void { nextFrame(); //opens a new function and when the fuction is functioned it will go to the next frame } my_btn.addEventListener(MouseEvent.CLICK, button); //gets your button by the instance name and when it it clicked it opens the function does it |
Rollover to those actions that you think that can be changed or just browse until you find one |
You can change that to the following prevFrame(); - goes to the previous frame gotoAndStop(frame#); - it goes to a frame an stops it (change frame# to the frame you want and you can change stop to play if you dont want it to stop nextscene(); - goes to the next scene if you inserted one stop(); - stops the movie play(); - plays the movie that's all the basics!! |
Now there are tons of actions to replace that but here are the basics for a while ROLL_OVER- When you rollover the button ROLL_OUT-When you rollover then you rollout of the button MOUSE_WHEEL-When you use the scroll wheel while your mouse is over the button MOUSE_MOVE-This executes faster that the Rollver script just like when you rollver the button |
Well that mostly covers everything about buttons but if you want to make multiple just change the instance name (but dont take out the the _btn) and change the function name now if you press next you will be taken in another topic prepare!! |
Timer |
Custom Text Here 00:00 |
This is what we're are gonna do |
Now to do the timer is just pretty easy 1st make a dynamic text box with the instance name of time and look out for the code at the next frame |
Now put this in your frame |
var startingTime:int = getTimer (); addEventListener(Event.ENTER_FRAME, calculateDifference); function calculateDifference(event:Event) { var timePassed:int = getTimer() - startingTime; var seconds:int = Math.floor (timePassed / 1000); var minutes:int = Math.floor (seconds / 60); seconds -= minutes * 60; if (seconds < 10) { time.text = String ("Custom Text Here: " + minutes +":0" + seconds); } else if (seconds >= 10) { time.text = String ("Custom Text Here: " + minutes + ":" + seconds); } } |
Change custom text here to the text you like that will appear beside the coutdown |
Now easy was'nt it so if you press next you will be leaded in the next topic :p |
Drag & Drop |
Now here's an example on what we're gonna do |
Mr. Graggable |
To do that 1st make a movieclip (ctrl+f8) then give it an instance name of DragMC |
Now insert these actions at the frame |
var dragging:Boolean = false; DragMC.addEventListener(MouseEvent.MOUSE_DOWN, press); function press(evnt:Event):void { DragMC.startDrag(); dragging = true; } DragMC.addEventListener(MouseEvent.MOUSE_UP, release); function release(evnt:Event):void { DragMC.stopDrag(); dragging = false; } |
Take this out if you want it to drag FOREVER (in the flash of course :p) |
Right Click menu |
Fancy my right click menu see for me I had a bit of fuzz making that thing nd compiler errors can be seen all the time but now I perfected it with tons customable parts |
var mymenu:ContextMenu= new ContextMenu(); mymenu.hideBuiltInItems(); var txt:String='My Webpage'; //You can change my webpage with the label that will appear at the menu var item:ContextMenuItem= new ContextMenuItem(txt); mymenu.customItems.push(item); item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,item_select); function item_select(e:ContextMenuEvent):void { var url:String='jaye19.newgrounds.com'; //Change the website above to the website you want var site:URLRequest=new URLRequest(url); navigateToURL(site); } this.contextMenu=mymenu; |
Code for Right Click Links |
var mymenu:ContextMenu= new ContextMenu(); mymenu.hideBuiltInItems(); var txt:String='Next Frame'; //Change that to label you want that will appear at the menu var item:ContextMenuItem= new ContextMenuItem(txt); mymenu.customItems.push(item); item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,item_select); function item_select(e:ContextMenuEvent):void { var String=nextFrame(); //You can change nextFrame(); to the normal things like prevFrame(); //gotoAndStop(2); etc. } this.contextMenu=mymenu; |
Code for Right Click Custom Function |
var mymenu:ContextMenu= new ContextMenu(); mymenu.hideBuiltInItems(); var txt:String='Low quality'; //Change that to label you want that will appear at the menu var item:ContextMenuItem= new ContextMenuItem(txt); mymenu.customItems.push(item); item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,item_select); function item_select(e:ContextMenuEvent):void { var String=stage.quality = StageQuality.LOW; //Change LOW to the quality type you want } this.contextMenu=mymenu; |
Code for Right Click Quality |
Well that all for right click menu in flash but try to discover more of it I know you can :) |
The Buh-Bye Section :'( |
Now that concludes everything of this tutorial so if you want to download this the instruction is seen in my comments so Bye :) |
ActionScript [AS3]
Section 1//MainTimeline (LOL_fla.MainTimeline) package LOL_fla { import flash.events.*; import flash.display.*; import flash.ui.*; import flash.text.*; import flash.utils.*; public dynamic class MainTimeline extends MovieClip { public var back_btn:SimpleButton; public var mymenu:ContextMenu; public var next_btn:SimpleButton; public var item:ContextMenuItem; public var lbar:MovieClip; public var startingTime:int; public var lpc:TextField; public var txt:String; public var dragging:Boolean; public var time:TextField; public var play_btn:SimpleButton; public var main_btn:SimpleButton; public var DragMC:MovieClip; public function MainTimeline(){ addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24); } public function release(_arg1:Event):void{ DragMC.stopDrag(); dragging = false; } function frame19(){ stop(); } public function onIntroCli(_arg1:MouseEvent):void{ nextFrame(); } public function onIntroCl(_arg1:MouseEvent):void{ nextFrame(); } public function onIntroCi(_arg1:MouseEvent):void{ gotoAndStop(4); } function frame10(){ stop(); } function frame14(){ stop(); } public function calculateDifference(_arg1:Event){ var _local2:int; var _local3:int; var _local4:int; _local2 = (getTimer() - startingTime); _local3 = Math.floor((_local2 / 1000)); _local4 = Math.floor((_local3 / 60)); _local3 = (_local3 - (_local4 * 60)); if (_local3 < 10){ time.text = String(((("Custom Text Here: " + _local4) + ":0") + _local3)); } else { if (_local3 >= 10){ time.text = String(((("Custom Text Here: " + _local4) + ":") + _local3)); }; }; } function frame18(){ stop(); } function frame3(){ this.stop(); next_btn.addEventListener(MouseEvent.CLICK, onIntroClick); } function frame7(){ stop(); } function frame1(){ this.stop(); this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING); } public function jj(_arg1:MouseEvent):void{ gotoAndStop(5); } function frame17(){ stop(); } function frame4(){ stop(); this.stop(); next_btn.addEventListener(MouseEvent.CLICK, jj); mymenu = new ContextMenu(); mymenu.hideBuiltInItems(); txt = "Hi this is Jaye19 please enjoy the tut!!!"; item = new ContextMenuItem(txt); mymenu.customItems.push(item); item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, item_select); this.contextMenu = mymenu; } function frame5(){ this.stop(); next_btn.addEventListener(MouseEvent.CLICK, onIntroCli); stop(); back_btn.addEventListener(MouseEvent.CLICK, onIntroClic); this.stop(); main_btn.addEventListener(MouseEvent.CLICK, onIntroCi); stop(); } function frame9(){ stop(); } public function press(_arg1:Event):void{ DragMC.startDrag(); dragging = true; } function frame16(){ dragging = false; DragMC.addEventListener(MouseEvent.MOUSE_DOWN, press); DragMC.addEventListener(MouseEvent.MOUSE_UP, release); } function frame8(){ stop(); } function frame21(){ stop(); } function frame2(){ stop(); stop(); play_btn.addEventListener(MouseEvent.CLICK, onIntroCl); } function frame15(){ stop(); } function frame23(){ stop(); } function frame24(){ stop(); } function frame13(){ stop(); } function frame20(){ stop(); } function frame11(){ stop(); } function frame22(){ stop(); } public function item_select(_arg1:ContextMenuEvent):void{ var _local2:*; _local2 = stop(); } function frame6(){ stop(); } public function onIntroClic(_arg1:MouseEvent):void{ prevFrame(); } function frame12(){ stop(); startingTime = getTimer(); addEventListener(Event.ENTER_FRAME, calculateDifference); } public function onIntroClick(_arg1:MouseEvent):void{ nextFrame(); } public function PL_LOADING(_arg1:ProgressEvent):void{ var _local2:Number; _local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100); lbar.scaleX = (_local2 / 100); lpc.text = (int(_local2) + "%"); if (_local2 == 100){ this.gotoAndStop(2); }; } } }//package LOL_flaSection 2//Symbol10_11 (LOL_fla.Symbol10_11) package LOL_fla { import flash.display.*; public dynamic class Symbol10_11 extends MovieClip { public function Symbol10_11(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package LOL_flaSection 3//Symbol16_4 (LOL_fla.Symbol16_4) package LOL_fla { import flash.display.*; public dynamic class Symbol16_4 extends MovieClip { public function Symbol16_4(){ addFrameScript(79, frame80); } function frame80(){ stop(); } } }//package LOL_flaSection 4//Symbol19_9 (LOL_fla.Symbol19_9) package LOL_fla { import flash.display.*; public dynamic class Symbol19_9 extends MovieClip { public function Symbol19_9(){ addFrameScript(24, frame25); } function frame25(){ stop(); } } }//package LOL_fla
Library Items
Symbol 1 Font | Used by:2 5 | |
Symbol 2 Text | Uses:1 | Used by:6 |
Symbol 3 Graphic | Used by:4 | |
Symbol 4 MovieClip | Uses:3 | Used by:6 |
Symbol 5 Text | Uses:1 | Used by:6 |
Symbol 6 MovieClip | Uses:2 4 5 | Used by:Timeline |
Symbol 7 Font | Used by:8 11 13 14 15 16 17 18 19 22 25 27 28 29 30 38 39 40 41 44 45 46 47 48 49 53 68 69 70 71 72 73 74 75 76 77 78 80 82 84 85 86 87 88 89 90 91 92 93 94 95 97 98 | |
Symbol 8 EditableText | Uses:7 | Used by:Timeline |
Symbol 9 Graphic | Used by:10 | |
Symbol 10 MovieClip | Uses:9 | Used by:Timeline |
Symbol 11 Text | Uses:7 | Used by:24 |
Symbol 12 Sound | Used by:24 | |
Symbol 13 Text | Uses:7 | Used by:24 |
Symbol 14 Text | Uses:7 | Used by:24 |
Symbol 15 Text | Uses:7 | Used by:24 |
Symbol 16 Text | Uses:7 | Used by:24 |
Symbol 17 Text | Uses:7 | Used by:24 |
Symbol 18 Text | Uses:7 | Used by:24 |
Symbol 19 Text | Uses:7 | Used by:20 |
Symbol 20 MovieClip | Uses:19 | Used by:24 |
Symbol 21 Sound | Used by:24 | |
Symbol 22 Text | Uses:7 | Used by:24 |
Symbol 23 Sound | Used by:24 | |
Symbol 24 MovieClip {LOL_fla.Symbol16_4} | Uses:11 12 13 14 15 16 17 18 20 21 22 23 | Used by:Timeline |
Symbol 25 Text | Uses:7 | Used by:26 |
Symbol 26 Button | Uses:25 | Used by:Timeline |
Symbol 27 Text | Uses:7 | Used by:Timeline |
Symbol 28 Text | Uses:7 | Used by:Timeline |
Symbol 29 Text | Uses:7 | Used by:Timeline |
Symbol 30 Text | Uses:7 | Used by:Timeline |
Symbol 31 Graphic | Used by:32 | |
Symbol 32 MovieClip | Uses:31 | Used by:36 |
Symbol 33 Graphic | Used by:34 36 57 61 62 66 | |
Symbol 34 MovieClip | Uses:33 | Used by:35 |
Symbol 35 MovieClip {LOL_fla.Symbol19_9} | Uses:34 | Used by:36 |
Symbol 36 Button | Uses:32 35 33 | Used by:Timeline |
Symbol 37 Sound | Used by:Timeline | |
Symbol 38 Text | Uses:7 | Used by:Timeline |
Symbol 39 Text | Uses:7 | Used by:Timeline |
Symbol 40 Text | Uses:7 | Used by:Timeline |
Symbol 41 Text | Uses:7 | Used by:Timeline |
Symbol 42 Bitmap | Used by:43 | |
Symbol 43 Graphic | Uses:42 | Used by:Timeline |
Symbol 44 Text | Uses:7 | Used by:Timeline |
Symbol 45 Text | Uses:7 | Used by:Timeline |
Symbol 46 Text | Uses:7 | Used by:Timeline |
Symbol 47 Text | Uses:7 | Used by:Timeline |
Symbol 48 Text | Uses:7 | Used by:Timeline |
Symbol 49 Text | Uses:7 | Used by:Timeline |
Symbol 50 Font | Used by:51 54 | |
Symbol 51 EditableText | Uses:50 | Used by:Timeline |
Symbol 52 Font | Used by:53 72 | |
Symbol 53 Text | Uses:7 52 | Used by:Timeline |
Symbol 54 EditableText | Uses:50 | Used by:Timeline |
Symbol 55 Font | Used by:56 | |
Symbol 56 Text | Uses:55 | Used by:67 |
Symbol 57 MovieClip | Uses:33 | Used by:62 |
Symbol 58 Graphic | Used by:62 | |
Symbol 59 Font | Used by:60 65 | |
Symbol 60 Text | Uses:59 | Used by:62 |
Symbol 61 MovieClip | Uses:33 | Used by:62 63 |
Symbol 62 Button | Uses:57 58 60 61 33 | Used by:67 |
Symbol 63 MovieClip | Uses:61 | Used by:66 |
Symbol 64 Graphic | Used by:66 | |
Symbol 65 Text | Uses:59 | Used by:66 |
Symbol 66 Button | Uses:63 64 65 33 | Used by:67 |
Symbol 67 MovieClip {LOL_fla.Symbol10_11} | Uses:56 62 66 | Used by:Timeline |
Symbol 68 Text | Uses:7 | Used by:Timeline |
Symbol 69 Text | Uses:7 | Used by:Timeline |
Symbol 70 EditableText | Uses:7 | Used by:Timeline |
Symbol 71 Text | Uses:7 | Used by:Timeline |
Symbol 72 Text | Uses:7 52 | Used by:Timeline |
Symbol 73 Text | Uses:7 | Used by:Timeline |
Symbol 74 EditableText | Uses:7 | Used by:Timeline |
Symbol 75 Text | Uses:7 | Used by:Timeline |
Symbol 76 Text | Uses:7 | Used by:Timeline |
Symbol 77 Text | Uses:7 | Used by:Timeline |
Symbol 78 Text | Uses:7 | Used by:Timeline |
Symbol 79 Graphic | Used by:81 | |
Symbol 80 Text | Uses:7 | Used by:81 |
Symbol 81 MovieClip | Uses:79 80 | Used by:Timeline |
Symbol 82 Text | Uses:7 | Used by:Timeline |
Symbol 83 Graphic | Used by:Timeline | |
Symbol 84 Text | Uses:7 | Used by:Timeline |
Symbol 85 EditableText | Uses:7 | Used by:Timeline |
Symbol 86 Text | Uses:7 | Used by:Timeline |
Symbol 87 Text | Uses:7 | Used by:Timeline |
Symbol 88 Text | Uses:7 | Used by:Timeline |
Symbol 89 EditableText | Uses:7 | Used by:Timeline |
Symbol 90 Text | Uses:7 | Used by:Timeline |
Symbol 91 EditableText | Uses:7 | Used by:Timeline |
Symbol 92 Text | Uses:7 | Used by:Timeline |
Symbol 93 EditableText | Uses:7 | Used by:Timeline |
Symbol 94 Text | Uses:7 | Used by:Timeline |
Symbol 95 Text | Uses:7 | Used by:Timeline |
Symbol 96 Graphic | Used by:Timeline | |
Symbol 97 Text | Uses:7 | Used by:Timeline |
Symbol 98 Text | Uses:7 | Used by:Timeline |
Instance Names
"lpc" | Frame 1 | Symbol 8 EditableText |
"lbar" | Frame 1 | Symbol 10 MovieClip |
"play_btn" | Frame 2 | Symbol 26 Button |
"next_btn" | Frame 3 | Symbol 36 Button |
"main_btn" | Frame 5 | Symbol 36 Button |
"next_btn" | Frame 5 | Symbol 36 Button |
"back_btn" | Frame 5 | Symbol 36 Button |
"time" | Frame 12 | Symbol 70 EditableText |
"DragMC" | Frame 16 | Symbol 81 MovieClip |
Special Tags
FileAttributes (69) | Timeline Frame 1 | Access local files only, Metadata not present, AS3. |
Labels
"drag" | Frame 18 |
|