Cool Websites Design - Website Design Layouts, Web Site Design Resources
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 5

In the previous article of Flash 5 Tutorial Series we had discussed about Set Variable, Set Property, Get Property, XY Position, XY Scale, Visibility, Rotation & Alpha. Now let’s Continue with Math Objects, Date & String Function.

Math Object I

LN 2
Returns the natural logarithm of 2 (approx 0.693)

Syntax :
Math . LN2

Example :
trace (Math.LN2);

The output window will show a value 0.693

PI
Returns the ratio of circumference of the circle to its diameter.

Syntax :
Math.PI;

Example :
trace (Math.PI);

The output window will show a value of 3.14

SQRT2
Returns the square root of 2

Syntax :
Math.SQRT2;

Example :
trace (Math.SQRT2);

The output will be 1.414

LOG 2E
The logarithm of E to the base of 2

Syntax :
Math. LOG 2E;

Example :
trace (Math. LOG 2E);

The output will be approximately 1.442

E
Returns the Euler's constant and the base are of natural logarithms.

Syntax :
Math.E;

Example :
trace (Math.E);

The output window will display a value of 2.718.

Math Object II

Math object is the top level object which can be used without using a constructor. With the methods and properties of this object, any kind of mathematical accessing and manipulation can be done.

There are several methods of math object. They are:

abs
Returns the absolute value of a number.

Syntax:
Math. abs ();

Example:
On (press)
{
trace (Math. abs (-3.2));
}

The output window will show 3.2 as the value.

cos, sin, tan
Returns the cos, sin and tan value of a number.

Syntax:
Math .sin ( );
Math .cos ( );
Math .tan ( );

Example:
On(press)
{
trace (Math.sin(45));
trace (Math.cos (45));
trace (Math. tan (45));
}

The output will be 3.2
0.5253219
0.850903
1.6197751

POW
Returns the value of x raised to the power of y.

Syntax :
Math.pow (x,y)

Example :
trace (Math.pow(2,3))

The output window will show a value 8.

Sqrt
Returns the square root value of a number.

Syntax :
Math.Sqrt (x) :

X - number for which square root has to be found.

Example :
Math .Sqrt (4) ;

The output window will show a result 2.

Date

Get Year
Returns the year of the date object, according to the local time. The year displayed will be year - 1900.

Syntax :
variable.get year ( );

Example :
on (press)
{
a = new date ( );
b = a.get year( );
}

where a is instance of date holding the current date (i.e. 2001/17/10)
b will hold value "01" (i.e. 2001-1900)

The last two digit of the year will be displayed, if getyear command is used.

Get Full Year
Returns the full year of the specified date, according to the local time.

Syntax :
variable .get full year ( );

Example :
a = new date ( );
b = a.getfull year ( );

where value of a be 2001/07/10
value of b will be "2001"

since get full year function will not display the last two digits, but it will give the full year (i.e. 2001).

Get Month
This command returns the month from the date object according to the local time.

Syntax :
variable.getmonth ( );

Example :
a = new date ( );
b = a.getmonth( );


where the variable a holds 2001/07/10 (year, month, date, hour, minute, sec, milli sec)
the variable b holds "10", the date will be displayed in the format (year/month/date).


Goto Page
 
1
 
 
 
 
 
 



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