|
What are object properties ?
Everything you design in Swishmax is an object, like SPRITE is an object, the TEXT you write is also is TEXT OBJECT. Shapes are Shape Objects. We can easily set/change properties. And assign new values to any object's properties.
You can create Shape Objects using the following drawing tools:
Line Pencil Bezier Rectangle Ellipse AutoShapes.
OBJECT PROPERTIES
- _X = for X-axis of an object
- _Y = for Y-axis of an object
- _xscale = for strecthing abject on x-axis <--->
- _yscale = for strecthing abject on y-axis (top to bottom)
- _alpha = for objects alpha value (transparency)
- _rotation = rotating object on x-axis
- _visible = this is a boolean expression (true or false)
- _height = height of an object
- _width = width of an object
- _name = return name an object
DESCRIPTION
Assigning Values to Object Properties NOTE : when you make an object dont forget to give object name and CHECK the button target.
It is not much difficult to understand the properties of objects. You can easily assign new values or retrieve the actual values by different methods. Its really easy to assign new values to each property e.g you have a SHAPE Object, and its name is myshape now you will assign values like this
onFrame (1) { myshape._X=200; myshape._y=100; myshape._height=10; myshape._width=10; myshape._xscale=200; myshape._yscale=400; myshape._alpha=100; myshape._rotation=0; myshape._visible=true; }
In my example I made a rectangle of widht=1 and height=1 and placed it on x=0 and y=0. When I will play my Movie, all the values will be changed automatically. If you will set myshape._visible=false; the object will be hidden.
Retrieving actual property values of Object
This is also not difficult to understand, what you have to do is simply make a variable and assign it the object property variable, for example you want to get the value of Shape object myshape and save it to any other variable newX, then simple do it like this
newX=myshape._X;
now the variable newX contains the value X-axis of myshape object. I thinks now it will be clear to you, what are object properties and how to handle them. It may help the beginners to SWiSHScript.
regards - Ali Roman..
|