Cool Web Designer - Best Web Site Design, Web Site Design Inspiration
Cool web design sites


  www.print-templates.com

 
Photoshop 5.5
Front Page 2000
HTML
XML
PageMaker 6.5

Community
 
Login
Create Profile
Forgot Password

Functions
 
Home
About cwd.dk
Contact Us

Inspiration
 
New Sites
Search
'Accepted by' Logo
Submit Site
Reminder
FAQ's
 Category
Animation
Audio/Sound
Business Style
Clean and Simple
E-Commerce
Entertainment
Experimental
Heavy Graphic
Intro
Just Nice
Navigation
Personal
Sports
Webportals
All Categories


www.imageonline.co.in




Articles

  By: Layout Galaxy
  Published   05-06-2003
  Category   Flash 5.0 Tutorial
  Type   Advance
  Rating
   0%
100%
Rate this article:  Bad  Good 

Advance Scripting In Flash - Part 7

In the previous article of Flash 5 Tutorial Series we had discussed Bitwise Operators, Comparison Operators, Logical Operators, Numeric Operators, String Operators, Operators. Now let’s Continue with While Statement, If & Else Statement, Start & Stop Drag, Focus Rectangle, Sound Buftime, & High Quality.

While Statement

Using while statement, a series of statements is repeated in a loop as long as the condition is true. If the specified condition is not satisfied, the condition returns (Boolean value) false and the loop won't be executed.

For each and every loop, flash restarts the loop by testing the condition. If the condition is false, flash skips the rest of the statements. Looping is performed repeatedly until the condition is false.

Syntax :
while (condition)
{
// statements;
}
Where condition is used to evaluate the loop each time when the loop is performed.

Statements are expressions to run, if the condition returns true.

Example:
x = 0;
While (x<=10)
{
trace (x);
x=x+1;
}

Initially, x value is zero and the condition is x<=10. If the value is less than 10, then x value will be traced. Then value of x is incremented and again the loop starts and it end only if the value of x is greater than 10. (i.e. condition returns false).

IF Statement

This statement (if) is used to evaluate the condition to determine the next action in the movie. If the specified condition is true, flash runs the rest of the statements.

If statement is used to create a branching logic in scripts.

Syntax:
If (condition)
{
// statements ;
}

Where condition is the expression which evaluates to true or false.

Example:
If (name = = "galaxy")
{
goto and stop (5);
}

If the value given by user is equal to the original name, then it will move to fifth frame, otherwise it won't enter the loop.

Else Statement

An alternative statement to run the if condition. If the value of IF statement is false, then ELSE condition is executed.

Syntax:
If (condition)
{
// statements ;
}
else
{
// statements;
}

where the condition is false and automatically control is shifted to else statements. Then corresponding statements of else is executed.

Example:
If (name = = "galaxy")
{
gotoAnd Play(5);
}
else
{
goto And stop(1);
}

In the example, if the value entered by the user is equal to "galaxy", then frame 5 will be played. If the value is not equal to galaxy, then it will stop in frame 1.

Start Drag

This command is used to make the target movie clip as draggble, while playing the movie. The object can be dragged, anywhere as the mouse cursor moves.

Start drag operation starts and the movie clip is draggable until it is explicitly stopped.

Syntax:
Start drag (target, [lock, [L, B, R, T]])

Where target is the instance name of the movie.

Lock is used to lock the mouse to the center point of the object.

L, B, R, T is Left, Bottom, Right and Top values of the object when mouse is moved or pressed.

Example :1
Start drag ("car", true);

Lock mouse to center - True / false

In the above example, car is the instance name and mouse is locked to the center and movie is draggable.

Example:2
Start drag ( "Car", true, 25, 50, 25, 50);

In this example, while pressing the button, the object/movie clip will be moved to the corresponding (L, T, B, R) location.

In start drag, the movie clip can be made draggable (or) move it to corresponding position.

Stop Drag

Stop Drag will stop the current dragging operation. Once the start drag operation is started, only by using stop drag command, it can be stopped.

Syntax:
stop drag( );

It has no parameters.

Example :
on (press)
{
stop drag ( );
}

While pressing the button dragging option will be stopped.

Show Focus Rectangle

Using this command, a yellow rectangle can be obtained for button which has the focus. This accepts only Boolean value.

Syntax:

Show focus rectangle = (Boolean value)
_focusrect = (true/false)

If the tab button is used, then the corresponding button which obtains the focus will have a yellow rectangle.

Example:
on (press)
{
_focusrect;
}

while using the tab key, the focus is brought to the button and a yellow rectangle appears on the button.

Sound Buftime

This command is used to establish the number of second of streaming sound to pre buffer. The default value is 5 seconds. It only accepts integer.

Syntax:
_soundbuftime = integer;

Default value is 5 second and any value can be specified for buffer time.

High Quality

Anti-aliasing can be given to objects to smoothen the ends. To smoothen the bitmap, specify high quality value to 1. To obtain high quality, specify 2. If value 0 is specified, low quality is obtained and it will prevent anti-aliasing.

Syntax:
_highquality = value ;

value can be 0,1,2

0 - low quality

1 - smoothing
2 - high quality

Name : This command is used to set or retrieve the value of a instance name of a movie clip.

The value can be set using the name command.

Syntax:
instancename._name; - retrieve the value
instancename.name = value; to set the value

Article by:

Layout Galaxy web site design templates for photoshop and Flash.

All accompanying logos, brands and product names are trademarks of their respective companies.

Blood for humans comes only from humans : Donate Blood
http://www.donate-blood.org   E-mail- om@donate-blood.org


Login
 
Enter your username and password, and press 'Submit'
Auto Login
Create Profile

Articles
 
 Search Engine   Optimization
Where does your Site Rank on Google?
Title Tag and Meta Description Tag Optimization
Anchor Text Optimization
Working with the robots.txt file
Google PageRank Algorithm Explained
 
 General
Alexa - The Smart Browsing
Web Promotion with Pay Per Click
Fonts in Layout
Basics of Color - 2
Basics of Color
 
 Dreamweaver
How to create a webpage using layers?
 
 Photoshop
Fine tune / touch up dull Image using Photoshop
Create thumbnails using Action and Automate in Adobe Photoshop.
Designing Top Panel in Photoshop - 2
Designing Top Panel in Photoshop
How to animate a banner using Adobe ImageReady?
 
 Flash
Publishing digital video on web page using Flash 2004
Creating Feedback form using Flash MX & send the data to email.
Image Transitions in Flash Mx
Creating Top Panel in Flash along with navigation bar
Creating Scrolling Buttons Menu in Flash MX
 
 Flash 5.0 Tutorial
Advance Scripting In Flash - Part 8
Advance Scripting In Flash - Part 7
Advance Scripting In Flash - Part 6
Advance Scripting In Flash - Part 5
Advance Scripting In Flash - Part 4
 
 Professional steps of  web designing
Professional Step-by-step Guide To Web Designing
Modify the ready-made Layout to incorporate your client's detail
Make Layout Web Compatible
Provide links using web-authoring tool like Macromedia Dreamweaver

Feedback
 

 

Layout Galaxy is ready to use photoshop & flash web site design templates
Copyright © 2001 Cool Web Design