Interact with MovieClip

There are many features of the MovieClip  that we can change by the code :

  • x and y position :
    • star_mc.x = 200;
    • star_mc.y = 300;
  • alpha to change the clearness of the MovieClip :
    • star_mc.alpha = 0.5;
    • star_mc.alpha = 0;                  //The MovieClip will NOT be visible
    • star_mc.alpha = 1;                  //The MovieClip will be visible and clear
  • rotation to rotate the MovieClip :
    • star_mc.rotation = 30;       //clockwise rotation
    • star_mc.rotation = -30;      //anticlockwise rotation
    • star_mc.rotation = 180;
    • star_mc.rotation = 360;
  • width and height :
    • star_mc.width = 100;
    • star_mc.height = 100;
  • scaleX and scaleY to stretch the MovieClip :
    • star_mc.scaleX = 2;           //duplicate x scale
    • star_mc.scaleY = 2;           //duplicate y scale
  • buttonMode to give the MovieClip the Button touch :
    • star_mc.buttonMode = true;    
    • star_mc.buttonMode = false;   
  • totalFrames return the total number of MovieClip key frames :
    • trace(star_mc.totalFrames);
  • currentFrame return the number of the current MovieClip key frame :
    • trace(star_mc.currentFrame );
  • mask : make another MovieClip as a mask for our MovieClip :
    • star_mc.mask(mask_mc);
  • mouseChildren : enable or disaple the mouse access to the content of the Movieclip
    • star_mc.mouseChildren = false;       //can NOT access to the MovieClip content
    • star_mc.mouseChildren = true;        //can access to the MovieClip content

During our discussions we will use these features during our work according to what we want to do.

Advertisements
Tagged with: , , , , , , ,
Posted in Actionscript, Flash

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Follow AS3.0 for Flash Designers on WordPress.com
Archives
Categories
Follow me on Twitter
%d bloggers like this: