Basic Understading of Vriables - SWiSHMax Tutorials
 
  Buy Ebooks, Video Games, DVDs, Electronics and more !
Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads Make Money Online Blog . Free Image and Photo Sharing and Hosting

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Free image hosting
   Web Design Pakistan
   Swish Templates
   SWiSH Climax
   Talkfreelance Community
   Template Desire
   Lite boards
   Script Sector
   GimpTalk
   13dots
   Idea Designs
   PHP Cafe
   Sposatoettore
   Free swishmax templates
   Swishzone

Manage your site with Flax Article Content Management System
Basic Understading of Vriables
Category : SWiSHMax | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

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.


© 2002-2005 Flaxweb Network | Article Manager | Gimp Tutorials Library | RAD C++ Library | Free C/C++ Sourcecode |
Sites of interest : Web Design Blog | Swish Templates | Swishmax Ebook | Photoshop Templates | Gimp Tutorials | Text Forum | Make Money Online