Stair Calorie Calculator

April 16th, 2013

This stair calorie calculator demonstrates the use of the radio button and Math Utilities components. The Math Utilities component is used to round the displayed results to 2 decimal places. It may also helps you lose weight!

On my return from the gymnasium the other day, I was about to catch the lift to the 11th floor when I realised that it would be healthier to walk up the stairs instead.

After walking up the stairs, I then thought to myself was it worth it? How many Calories had I burnt? To figure it out I did some research and created the calculator below which will show the energy consumed climbing stairs.

Calculation Method Options

The Physics option calculates the result based on the difference in potential energy (mass * gravity * height). This represents the absolute minimum amount of energy that must have been expended to climb the stairs. However, as the human body expends energy walking on level ground or even down stairs, the actual value would be higher. A few web searches revealed that 5 kcal per flight of stairs for a 150lb person is a typically quoted amount. The Dept of Health option calculates on the basis of a 150lb person and 5kcal per flight. The 5kcal / flight figure was quoted as coming from the New Hampshire Department of Health and Human Services, hence Dept of Health is used to identify that calculation method. I have assumed that the figure is proportional to weight so the calculator modifies the results proportionally according to the entered weight.

Read the rest of this entry »

Using the ColorTransform object

February 19th, 2013

The now deprecated Color object was the subject of the previous blog article. If you have not read that article, please do so as it provides a useful introduction. The more complex ColorTransform object allows the user alter an objects color and alpha based on existing values and applied multipliers and offsets.

When a ColorTransform object is used, each color channel is calculated using the following formulas:

  • red value = (original red value * redMultiplier) + redOffset
  • green value = (original green value * greenMultiplier) + greenOffset
  • blue value = (original blue value * blueMultiplier) + blueOffset
  • alpha value = (original alpha value * alphaMultiplier) + alphaOffset

The calculated value is clipped so that it falls in the range 0 to 255. (ie a value > 255 is changed to 255. A value < 0 is changed to 0).

The example movie above demonstrates the Transform being applied to a gradient shaded object. Press the play button to see the effect. Unlike the Color object, each color in the gradient is changed to a new color after the transform. This is not possible with the Color object which would change the entire object into a new single color. Note that as the offsets are altered, the object color tends towards white because of the clipping.

Read the rest of this entry »

Using the Color object

February 1st, 2013

The Color object was introduced in Flash Player 6. It is deprecated since Flash Player 8. Although the replacement ColorTransform object provides additional flexibility, the original Color object is easier to use and understand. Consequently, it is still used in spite of its deprecated status.

The ColorTransform object should be used in all new projects. The older Color object is discussed here as it provides a useful introduction to the theory of altering color using script. The ColorTransform object will be discussed in a future article.

Read the rest of this entry »

New Component: 3dCube

July 16th, 2012

This SWiSH Max4 component displays 6 images in a rotating cube. The cube rotates towards the current mouse position. Parameter options exist to change the size, alter the speed, border color / width and to load different images.

 

Read the rest of this entry »

New Component: Barcode_QR

July 10th, 2012

Over a year ago we published an article about a Barcode_128 bar code generator component. In response to that article, some users requested a QR code generator component. QR Code (Quick Response Code) is a popular two dimensional matrix bar code that was invented by Denso in 1994. It has since become an ISO/IEC standard.

QR Code readers are freely available for iPhone, Android and other smart devices. Using a reader to read a QR Code allows information to be easily entered into the smart device without the tedium of having to use a small cramped keyboard. The information could include website URL, phone number, physical address, order, part number or contact information.

The QR code below contains the text: “http://www.swishzone.com”

Most QR readers recognize a website name and offer to open a browser window that refers to the site. If you have a mobile device with a QR code reader installed (eg. ZXing) you should be able to scan the image and then optionally browse the swishzone.com website.

QR Codes are a convenient way to publicize your website or business to mobile devices through conventional media: Posters, billboards, stickers, T-Shirts or other merchandising goods.

A QR code in a shop window is a great way for people to obtain information about your business from its mobile website if they arrive after normal business hours.

QR Codes are also a convenient way to allow the transfer the URL of a mobile specific website from a desktop computer into a mobile device.

The QR component described by this article allows users to create their own QR Codes.

Read the rest of this entry »

New Game: Memory

June 27th, 2012

This game will test and improve your memory. Tiles are animated in a random sequene. Once the sequence is complete, the player attempts to re-create the sequence. Points are scored for each tile that is selected in the correct sequence. If the sequence is remembered correctly, the next sequence is made longer. If the sequence is incorrect, the next sequence is made shorter.

The game runs over 10 “sequence frames”. This means a maximum possible score of 55.

Read the rest of this entry »


Switch to our mobile site