Flash
  Home arrow Flash arrow Basic Flash ActionScript for Designers
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Basic Flash ActionScript for Designers
By: Adi Reddy Mora
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 113
    2005-06-01

    Table of Contents:
  • Basic Flash ActionScript for Designers
  • Buttons, Movie Clips, and Making them Draggable
  • Navigating, URLs, and Loading Images
  • Loading External MP3 Files

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Basic Flash ActionScript for Designers


    (Page 1 of 4 )

    If you already know the basics of Flash, using tools and creating animations, you may want to add some interactivity to your work. ActionScript, an object oriented programming language built into Flash, is the key to this. Adi Reddy Mora explains the basics of ActionScript.

    I'll be using Flash MX 2004, and I'll assume that you're already familiar with working on the Timeline and creating animations with keyframes. You should also know how to create buttons and movie clips, as well as being able to publish a movie. It may be helpful to review my previous article, What is ActionScript for some real basics. That said, let's look at editing movie clips.

    Controlling movie clips

    To control movies with ActionScript, you should name movie clip instances, which will uniquely identify them as objects. As objects, ActionScript can controlled them. When you give a movie clip instance an instance name, the instance name identifies it as an object of the MovieClip class.

    You can use global ActionScript functions or the methods of the MovieClip class to perform tasks on movie clips. To use a method, you need to invoke it by using the target path of the instance name and then the method name and parameters, as shown in the following examples:

    // Plays the movie clip with instance name “anim_mc”
    anim_mc.play();
    // Sends the playhead to frame 3 in the movie clip with instance name
    // “subanim_mc” and plays it, which is inside “anim_mc”
    anim_mc.subanim_mc.gotoAndPlay(3);

    Note that using suffix _mc is a good practice while naming movie clip instance names.

    You can use the following methods and properties to control movie clips:

    // Stops the movie clip “anim_mc”
    anim_mc.stop();
    // Sends the playhead to frame 10 in the movie clip with instance name
    // “anim_mc” and stops it
    anim_mc.gotoAndStop(10);

    // Sends the playhead to the next frame of the movie clip
    anim_mc.nextFrame();

    // Sends the playhead to the previous frame of the movie clip
    anim_mc.prevFrame();

    Besides the methods of the movie clip class, you can also use its properties to control behaviour and appreance.

    // Sets the transparency value of a movie clip instance
    anim_mc._alpha = 60;

    // Sets the height of a movie clip instance, in pixels
    anim_mc._height = 400;

    // Sets the width of a movie clip instance, in pixels
    anim_mc._width = 300;

    // Sets the degree of rotation of a movie clip instance
    anim_mc._rotation = 15;

    // Value that determines whether a movie clip instance is
    // visible or hidden (true or false)
    anim_mc._visible = false;

    // Sets the xcoordinate of a movie clip instance
    anim_mc._x = 25;

    // Sets the ycoordinate of a movie clip instance
    anim_mc._y = 125;

    More Flash Articles
    More By Adi Reddy Mora


       · Sir my name is "GagandeepCheema", Since few days I am trying to get forward with...
     

    FLASH ARTICLES

    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks
    - Building Preloaders
    - Fun Things to Do with Movie Clips in Flash MX
    - Referencing Movie Clips in Flash MX







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway