Width Property

Width Property

Flash CS4 ActionScript 3.0 Tutorial

 

How to Assign Width Property to Button Symbols, Movie Symbols and Text with Flash ActionScript

 

 

The width property controls an object's overall width. The values are set in pixels. The object's width alters based on its registration point. For more information about setting and moving the registration point, see topic, Setting and Moving Object Registration Point.

Tutorial Elements

Movie Symbol with instance name widthMovie_mc

 

Step One

Add a Movie Symbol to the stage and click the symbol with the Selection tool.

Step Two

Open the Properties panel (Cmd/F3 (PC-Ctrl/F3)) and type in the name widthMovie_mc for the Instance Name.

Step Three

Add a new layer called Actions.

Step Four

Option double-click (PC - Alt double-click) the keyframe in the Actions layer to open the ActionScript panel.

Step Five

Copy/Paste the following code to the ActionScript panel.

widthMovie_mc.width = 100;

Step Six

Test your movie by pressing Cmd/Return (PC - Ctrl/Enter). By setting width equal to 100, the object's width becomes 100 pixels.

Width and Scale

The width, scaleX and scaleY properties can be used to enlarge an object. Depending on the application, you should consider the possibilities.

 

Royalty-Free Stock Video at Pond5