| Advance Scripting In Flash - Part 4 | In the previous article of Flash 5 Tutorial Series we had discussed about FS Command, Stop all Sounds, Tell Target, If Frame is Loaded. Now lets Continue with Set Variable, Set Property, Get Property, XY Position, XY Scale, Visibility, Rotation & Alpha. Set Variable Using set variable, any value can be set to a variable. The name of the variable is declared and a value is assigned to it. Syntax: set variable = value; Example: x = 2; where x is the variable name & 2 is the value of the variable. Set Property Using this command, the property of the movie clip can be changed while playing the movie. The instance name of a movie clip is needed while making changes to the property of it. The set property has three arguments. Syntax: set property (target, property, value); Example: On (press) { set property ("plane", _xscale, 100); } where The Movie clip will expand in width by 100 of its original width. Get Property Using this action the value for the movie clip can be returned. Syntax: Get property (target, property); | target is the instance name of movie clip. | | Property is the property of movie clip (_x, _y, _xscale etc) | Example: On (press) { galaxy = get property ("plane", _x) +10; set property ("plane", _x, galaxy); } The x position of plane movie clip will be increased by ten (whenever the button is pressed) and stored in x variable. Now the set property will set the x value to the movie clip. In the above discussed example, We have galaxy = get property(); in which we have involvement of Set Variable and Get property commands. The next line explain us the Set Property command.
|