Flash
  Home arrow Flash arrow Page 2 - ActionScript 101
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  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
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

ActionScript 101
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 9
    2008-01-16

    Table of Contents:
  • ActionScript 101
  • Working with Properties
  • Width/Height
  • Visibility
  • Alpha

  • 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


    ActionScript 101 - Working with Properties


    (Page 2 of 5 )

    Properties define certain characteristics of Symbols in Flash. Using ActionScript, we can change these properties to create some pretty cool effects. In this tutorial, we will learn to do just that.

    Below is a table listing the Symbol Properties.

     

    Property

    What it Does

    X. Y Coordinates

    The coordinates of an object indicate where it is located on the stage

    Width/Height Measures

    The width and height of an object

    Xscale, Yscale

    Adjusts the object size

    Visible

    Makes an object visible or invisible

    Rotation

    Sets the object's degree of rotation; i.e. by how much to rotate a ball

    Quality

    Used to change the quality of a scene (and therefore every object in the scene)

    Name

    Used to read or change the name of an object

    Alpha

    Affects the transparency of an object

    Xmouse, Ymouse

    Gives you the coordinates at which a user clicks their mouse

    CurrentFrame

    Tells you which layer in a movie is presently playing

    TotalFrame

    Tells you the total amount of frames in a movie

    URL

    Returns the URL of the SWF file the movie was downloaded from

    Target

    Returns the path of a movie clip

    DropTarget

    *Discussed in-depth later

    FocusRect

    Boolean that lets you know if a keyboard has focus

    FramesLoaded

    Tells you the total frames of a movie that were downloaded

    SoundBufTime

    *Discussed in-depth later.

    X, Y Coordinates

    As described above, X and Y represent the coordinates of an object. The best way to explain this is to actually work with the properties. Open up Flash and draw a shape on your stage. Change the shape to a symbol (press the F8 key) and name the image something like Mov_Rect or something along those lines. Set its Behavior as a Movie Clip and press the OK button.

    Next, select the shape you created and look at your Properties Pane (this should be located at the bottom of your window, below the stage). Where it says Instance Name, erase what is there and type in Rectangle.

    Finally, right-click the frame in the Timeline and choose Actions from the pop-up menu. Being sure that you have turned off the Script Assistant, type in the following code:


    onClipEvent (mouseDown) {

    setProperty("", _x, "250");

    setProperty("", _y, "250");

    }

    Now test the movie. If you click on the Rectangle object (or whatever object you created), its position on the stage will relocate. If you go back and change the coordinates to say, 300, and test the movie again, you the object will move to a new location once you click it.

    More Flash Articles
    More By James Payne


       · Hey, didn't see you there. Thanks for dropping by to read my article on...
       · Good article mate.Don't try to be funny ;)
       · Thank you! This was very helpful and easy to follow. Great examples.
     

    FLASH ARTICLES

    - Critical Flash Vulnerability Heats Up the Web
    - More on Nonpersistent Client-Side Remote Sha...
    - Nonpersistent Client-Side Remote Shared Obje...
    - Using the Decorator Pattern for a Real Web S...
    - Using Concrete Decorator Classes
    - Delving More Deeply into the Decorator Patte...
    - The Decorator Pattern in Action
    - A Simple Decorator Pattern Example
    - Decorator Pattern
    - Organizing Frames and Layers for Flash Anima...
    - Organizing Frames and Layers
    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    Stay green...Green IT