Flash
  Home arrow Flash arrow Page 3 - 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  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
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

ActionScript 101
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 8
    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

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    ActionScript 101 - Width/Height


    (Page 3 of 5 )

    The Width and Height properties define how tall and wide the object is. You can program them in a fashion similar to that of the X,Y coordinates. Here we will create a program that resizes the Rectangle object once the user clicks on it.


    onClipEvent (mouseDown) {

    setProperty("", _height, "300");

    setProperty("", _width, "300");

    }

    Xscale/YScale

    Another way to adjust the size of an object is with the Xscale and Yscale properties. These allow you to, using scale, stretch the size of an image. If I set both values at 50, the object will become half of its size. If I set them at 200, the object becomes twice its size.

    Here is some code that demonstrates how to change the properties:


    onClipEvent (mouseDown) {

    setProperty("", _xscale, "50");

    setProperty("", _y, "300");

    }

    You can fool around with different numbers to generate different effects. For instance, if you set either property to 0, then your object disappears. If you set it to a negative number like -100, it enlarges the picture in a weird way and relocates it.

    Here are some pretty pictures to demonstrate how this works.

    Before the user clicks on the image:




    After the user clicks on the image (value set to 200)



    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

    - 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 4 hosted by Hostway