Monday, January 4, 2010

setProperty function

Example

The following ActionScript creates a new movie clip and loads an image into it. The _xand _y coordinates are set for the clip using setProperty(). When you click the button called right_btn, the _xcoordinate of a movie clip named params_mc is incremented by 20 pixels.


this.createEmptyMovieClip("params_mc", 999);
params_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg");
setProperty(this.params_mc, _y, 20);
setProperty(this.params_mc, _x, 20);
this.right_btn.onRelease = function() {
setProperty(params_mc, _x, getProperty(params_mc, _x)+20);
};

No comments:

Post a Comment