Flash CS3 Tutorial, DragAndDrop
62Flash CS3 Tutorials
Flash CS4 Tutorials
- CSS, How To
Great Blog Dedicated to sharing great CSS Tutorials and How To Guides. - Flash CS4 Tutorials
Adobe Flash CS4 And CS3, The Information you really need is a website and ebook deidcated to provideing quality Flash CS4 Tutorials. - IT Admin
IT Admin is you home for all computer related issues. Stop by and check out what is going on in the it world from a real it professional. - Flash CS3 Tutorials, Home Page
F2, is a website dedicated to teaching Flash CS3, You will find all kinds of Flash CS3 Tutorials
Flash CS3 Tutorial, Drag and Drop
As always, some of the work has been done for you. If you open the file start01 you will see a big smiley face. The smiley face has been labeled smiley_mc. If you move into the smiley face MovieClip you will see a lot of key frames. Some basic animation as been created for you. This Flash CS3 Tutorial is about controlling graphics with the mouse, creating the tweens will not be covered. However, you will learn how to make the smiley face react to the mouse. Lets make the MovieClip do something every time the mouse moves over it. Start by coping the code from the example to the first key frame in the actions layer. smiley_mc.addEventListener(MouseEvent.MOUSE_OVER , smiley); function smiley(event:MouseEvent):void{
smiley_mc.play() };
The code creates an Event Listener and adds that Event Listener to the MovieClip smiley_mc. Event listeners have been covered in more depth other Flash CS3 Tutorials. The Event Listener is simply listening for the MouseEvent Mouse over. Then once the event happens ActionScript is telling the MovieClip smiley_mc to play.
Press Control-Enter to see the Smiley Face react.
If you once again go into the Smiley MovieClip and look at the key Frames you will see how this works. When the Event Listeners detects that the mouse has passed over or onto the smiley_mc, actionScript tells the smiley_mc to play, thus playing the movie until something tells the smiley_mc movie to stop. In this case there are key frames in the actions layer that simply have the stop action added to them. You can create any form of animation inside a movie clip then use action script to control when the movie plays.
Drag and Drop Lets add some more interactivity to the smiley face by adding a drag and drop ability.
Copy the example code and add it below the current event listener. smiley_mc.addEventListener(MouseEvent.MOUSE_DOWN , smileyDrag); function smileyDrag(event:MouseEvent):void{
smiley_mc.startDrag(); };
Once again you will see the slandered event listener. What is new would be the smiley_mc.startDrag();. The startDrag method tells Flash CS3 to enable a MovieClip to be moved around the stage. You define which MovieClip by placing the name of the MovieClip in front of the startDrag method, separated with a period. If you test the movie at this point you will see that when you click on the smiley face it movies with the mouse cursor., but how do you stop dragging the smiley around. Well, you need to add another Event Listener. smiley_mc.addEventListener(MouseEvent.MOUSE_UP , smileyStopDrag); function smileyStopDrag(event:MouseEvent):void{
smiley_mc.stopDrag(); };
The first Event Listener listened for the mouse to be pressed down. This time you need Flash CS3 to listen for the mouse up event. Since you want the smiley_mc to stop dragging when the mouse button is released you will add the method stopDrag to the MovieClip. Basically, you use the same thing to stop dragging as you do to start dragging.
See the Complete Flash Tutorial
Everything Computer Related
- CSS, How to understand inline and block level elements.
Block level elements are normally displayed as blocks with line breaks before and after. Examples of block level elements include paragraphs, headings, divs and block quotes. Inline elements are... - 3 months ago
- CSS, How To tweak css for only Safari?
If you have spent anytime dealing with CSS you have run into issues with a browser rendering code incorrectly. You may even have gone as far as to make several style sheets and use a browser check... - 3 months ago
- CSS, How to Hide Styles from Older Browsers?
Some older browsers, such as Netscape Navigator 4 and IE 4, have poor support for CSS. It is possible to hide styles from these browsers using specific media types and @import rules. All styles will... - 3 months ago
- CSS, How to use @import styles
@import Styles? Header and external style sheets also can import other style sheets using the @import rule. The @import rule must be placed before all other rules in the header or external style... - 3 months ago
- CSS, How to use External Style Sheets!
The third method of applying styles to document involves linking to external style sheets. External style sheets are the most appropriate method for styling documents. If styles need to be... - 3 months ago
- CSS, How to Use Header Styles
Header styles also can be used to style the <p> element. The CSS rules can be placed in the head of the document using the style element. Like inline styles, header styles, header styles... - 3 months ago
- CSS, How to Apply Inline Styles.
CSS, Inline styles can be applied directly to elements in the HTML code using the style attribute. However, inline styles should be avoided wherever possible because the styles are added to the HTML... - 3 months ago
- Twitter Weekly Updates for 2009-08-09
New blog post: CSS, What is a <div> http://bit.ly/Sbfu # Flash, ActionScript tutorials on loops http://bit.ly/QMq8t # Great PHP Tutorial on using include and require. Include is a great way... - 3 months ago
CSS How to
- Twitter Weekly Updates for 2009-11-22
The maker of iFart is sending a message to Steve Jobs and Apple: http://digg.com/d31ARUx?t # An Open Appeal to Steve Jobs: http://digg.com/d31ARUx?t # Powered by Twitter Tools - 3 days ago
- CSS, How to work with content areas.
The content are of a box can be given width, height, and color. Width and height can be specified in points (equal to 1/72 of an inch), picas (equal to 12 points), pixels, ems, exes, millimeters,... - 2 months ago
- Twitter Weekly Updates for 2009-09-20
My Farmville is broken, cant access, gifts, market, or ribbons # Farmville and zynga are a rip off. Watch out. There are still some glitches in the game and zynga told me to bad Im unimportant.... - 2 months ago
- Twitter Weekly Updates for 2009-09-06
I need 5 more neighbors on FarmVille help me out. http://bit.ly/tLsni # looking for flash tutorials and how to guides check out – http://frenchsquared.com/ # Powered by Twitter Tools - 3 months ago
- Twitter Weekly Updates for 2009-08-30
New version of Wordpress theme adStyle is live at: http://wordpress.org/extend/themes/adstyle # Just finished installing OS X 10.6 on my new Solid State drive. Very impressed, seems noticeably... - 3 months ago
- CSS, How to properly use Border Styles.
The border properties specify the width, color and style of the border of an element. Shorthand border properties include border-top, border-bottom, border-right, border-left and border. - 3 months ago
- CSS, How to Padding Padding and more Padding
Padding can be applied to the outside edges of the content area of any block level or inline element. Padding creates the space between the edge of the element and its content. - 3 months ago
- Twitter Weekly Updates for 2009-08-23
Wordpress liked my theme. They have asked that a make a few revisions and resubmit. Sounds like my theme may get accepted! # how long does it normally take for wordpress to get back to you after... - 3 months ago
PrintShare it! — Rate it: up down flag this hub
Comments
great flash tutorial, thanks for creating it
Interesting tutorial
<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} span.EmailStyle15 {mso-style-type:personal; mso-style-noshow:yes; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt; font-family:Arial; mso-ascii-font-family:Arial; mso-hansi-font-family:Arial; mso-bidi-font-family:Arial; color:windowtext;} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} -->
Anyway to drag and drop the object but it also leaves a copy of that object in the original
location?









frenchsquared says:
2 years ago
This site does offer content, that is a complete tutorial. Ask a flash guy