Home > Articles > Graphics & Web Design > Dreamweaver & Flash

  • Print
  • + Share This
This chapter is from the book

Dot Syntax

ActionScript uses what is called dot syntax. For example, if you have a movie clip called red_shirt inside of the movie clip called santa_claus, then one way to access that object is

_root.santa_claus.red_shirt

_root is the base of all Flash movies. If you want to find out where red_shirt is on the stage, you could use

xPosition = _root.santa_claus.red_shirt._x;

_x is a property that returns the horizontal position of the object. We'll talk more about properties soon.

If you're familiar with JavaScript, dot syntax will look familiar to you: for example,

document.myForm.textBox.value = "Try again!";
document.image['nav'].src = 'images/clickme.gif';

If you're familiar with Flash 4, you're used to the slash syntax. Hopefully, you'll find dot syntax a little more intuitive and easier to use.

  • + Share This
  • 🔖 Save To Your Account