|
|
|
Published : April 29, 2006 |
Author : Ali Roman
Category : Scripting languages | Total Views
: 474 | Unrated
|
|
|
|
What is variable.
A variable is a value that is not constant. This value is changed conditionally. For example weather is a variable, it is not same always. Now in SWiSHScript, for example "X" is a variable and its value is assigned x=10; in the beginning of Movie, but we want to change its value at runtime (means you can change value while your SWF file is playing), so we will simply assign a new value to "X" as x=20; at any frame.
Why we use variables?
Variables are used in many different ways to perform any specific task. For example for getting/changing X,Y postions of sprite, for changing alpha, width etc. You can direclty assign a new value to the object property (_width, _alpha, _X, _Y etc). Variables are also used to send/retierve data to/from PHP,ASP, JScript etc.
Here is an Example
For example you have a sprite named as circle and you want to know its X position (what is the exact locaion of x where circle sprite is located). Also check the provided example.
[swf=200x103]http://www.swish-db.com/Board/attach/smax/drgcir.swf[/swf]
On the very first frame of movie we have assigned a Static value to variable vartext
| CODE |
onFrame (1) { vartext=43; } | This variable is assigned to display its value 43 in dynamic textbox. Now see the Script on shape circle
| CODE |
on (press) { startDragUnlocked(); }
on (release) { stopDrag(); _root.vartext=_root.circle._X; } | here we have assigned a dynamic value to a variable vartext, which is not static, it changes when you drop cirle to any other point.
Download Example
In the above explanantion you have learned how to assign a vlaue to a variable. For more details about Data Types of variables please read the following tutorial. Data type is basically the characteristic of Variables (what kind of data they are supposed to handle i.e numeric, string, boolean).
http://www.swish-db.com/phpBB2/viewtopic.php?t=5469
regards Ali Roman.
|
|
|
Visitor's Comments ! |
|
|
|
Random Pick |
I usually work with companies and sign confidential documents in which I agree not to publish any work I have done for them anywhere even in my portfolio, so that's the reason my portfolio has not a LOT to browse, but yes of course there are a few things which I really like and would like to share here. I have recently developed an advance article and news content management system using PHP and MySQL at the backend, which makes it extremely easy to post article and news without any html or programming skills, you have got advance administration panel to perform required operations, the next update will certain boot its popularity since I have a lot in mind and the updates are already scheduled. here is the preview of my article manager. It is an advance article publishing system designed to make your life easier by enabling you to publish articles or news to your website quickly and easily with an advance WYSIWYG editor that includes features such as a built-in spell checker, with image, flash files and asset management and many more. |
|
|
Statistics |
| » Total Articles |
74
|
| » Total Authors |
103
|
| » Total Views |
123989
|
| » Total categories |
6
|
|