A Flash Developer Resource Site














Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11336 Flash Movies | 2 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: Surjit Dhami
» Title: Book
» Description: Book
» More by Surjit Dhami


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5848 Flash Sites | 0 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: All-American Rejects
» Description: Get to know this great band by exploring their "practice room".


Random Links | Add your own Flash Related Links
Flash Tutorials 1277 Tutorials 7 New Tutorials Added!
What's New | Top100

» Create xml slideshow with free template
» How to Insert a Multilingual Subtitle Into Your Flash Video Studio
» How to Create Cool Halloween Slideshow
» Debugging flash using the Firebug console
» Create Flash Slideshow on Blogger
» FLASH TRICKS IN WEB ADVERTISING: FLASH BANNERS
» HTML Photo Gallery Tutorial
» Create your first flash site – PART 1
» How to Make a Flash Photo Gallery
» Unknown Tag: Title10
Random Tutorial | Add Site

Webmaster (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Math-Physics

Categories Conversion of Number Systems
Author: Mr.Ehab

 
Page 2
«prev 1 2 3 4 5 6 7 next»

EXPLANATION

Let me tell you what numbers these systems have and the procedure I followed to convert a certain number from one system to another.
a. The decimal system takes numbers between 0 and 9 only
b. The Binary system takes 0 and 1 only
c. The Octal system that takes numbers between 0 and 7 only
d. The Hexadecimal system takes numbers between 0 to 9 in addition to the string charaters (A(10), B(11), C(12), D(13), E(14), F(15))

The procedure for converting is approximately common for all systems. I'll explain the simplest conversion (decimal to binary). If the user types 82 as a decimal number, I try to find all the numbers that are less than to this number such that these numbers are powers of 2. That is:
1, 2, 4, 8, 16, 32, 64 (and not 128)

Then, I write them inversely: 64, 32, 16, 8, 4, 2, 1

I take 64 and divide it by 82. I notice that there is one 64 in 82. The result is 1 (first digit in the binary system). I also compute the remainder, which is 18. Then I take 32 and divide it by 18 and notice that there is no 32 in 18 and the division yields zero. So, the first two digits in the binary number are 1 and 0. I proceed in the same manner until I get the binary number: 1010010.

Note: To convert to binary, we take powers of 2 and apply the same method. To convert to octal, we take powers of 8 and apply the same method. To convert to hexadecimal, we take powers of 16 and apply the same method.

The FLA file is available for download. Well, all we need is a single layer made up of 5 keyframes in the main timeline. The first keyframe contains the definitions of all the functions used. I used 6 functions that do the following:
1) Function decimalToHexadecimal that converts from decimal system to Hexadecimal system
2) Function decimalToOctal that converts from decimal system to octal system
3) Function binaryToDecimal that converts from binary system to decimal system
4) Function decimalToBinary that converts from decimal system to binary system
5) Function octalToDecimal that converts from octal system to decimal system
6) Function hexadecimalToDecimal that converts from hexadecimal system to decimal system

We'll go over the scripts of all these functions line by line to understand how they execute.

I used 4 radiobuttons from Common Libraries/Smart Clips that let the user chooses among the four number systems. For instance, if he chooses Decimal number system, then the second keyframe will be executed. When the user then types in the decimal number and presses the convert button, the corresponding number is converted to binary, octal, and hexadecimal using 3 dynamic variables that exist through out the last 4 frames in the main timeline. The dynamic variables are (output1, output2, and output3).

«prev 1 2 3 4 5 6 7 next»

» Level Intermediate

Added: : 2002-03-04
Rating: 6.83 Votes: 19
Hits: 1094
» Author
Student studying Computer Engineering and Graphic Design.
» Download
Download the files used in this tutorial.
Download (34 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments
 
   
 

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs