Web Development Logs
Find articles, news and reviews about latest technologies.


Welcome Guest !
please login or register a new free account.


Home | Archives | Submit Article | Top Rated | Advance Search | Contacts Us | Rss Feeds

    Main Categories
» Free downloads
» General Blog
» Google Adsense
» Scripting languages
» Search Engines
» Web Designing

  More Options
» Most read articles
» Most rated articles

   Subscription
Subscribe now and receive free articles and updates instantly.
» Your name » Your Email

titles description    advance search
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.




1 2 3 4 5
please rate this article     Poor
Excellent    
Most viewed articles in Scripting languages category

Retrieving data from MySQL database using php
Creating simple contact form using swishmax and php
Creating dynamic combo list with PHP and MySQL
Creating simple percentage preloader with swishmax
Saving data to a text file with swishmax and php
Most recent articles in Scripting languages category

Saving data to a text file with swishmax and php
Creating dynamic combo list with PHP and MySQL
Retrieving data from MySQL database using php
Establishing connection with MySQL using php
Creating table using MySQL database

 Visitor's Comments !

there are no 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

Delete cookies set by this site | Top   

Article Manager by Flaxweb
Copyright 2006 © Flax Article Manager v1.1