| Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact | |
GetPrice |
|
|
| Property | Defined By |
|---|---|
|
itemPrice
: Number
Single price of an item. |
GetPrice |
|
newItemPrice
: Number
When another item price is added to add up to the total price. |
GetPrice |
|
itemNumber
: int
The number of an item. |
GetPrice |
|
shipHandling
: Number
The price for shipping and handling. |
GetPrice |
|
noTaxPrice
: Number
The price before tax is added. |
GetPrice |
|
stateTax
: Number
The percent state tax to add to the total price. |
GetPrice |
|
rawPrice
: Number
The amount of state tax to add to the total price. |
GetPrice |
| Method | Defined By |
|---|---|
|
GetPrice.getInstance()
Creates a new instance of the GetPrice class. |
GetPrice |
|
addTax():String
Function returns the price total price including tax. |
GetPrice |
|
addPrice():String
Function returns the price after another item price has been added to the subtotal price. |
GetPrice |
|
adjustRawPrice():String
Function returns the price adjusted to two values after the comma. |
GetPrice |
|
simplePrice():String
Function returns the price of an item multiplied with its number. |
GetPrice |
|
subtractPrice():String
Function returns the price after an item price has been subtracted from the subtotal price. |
GetPrice |
| Property Detail |
|---|
|
itemPrice
property
itemPrice:Number [read-write] Value is the single price of an item. Default value is 0 . EXAMPLE: import biz.flashscript.shoppingcart.GetPrice; var gp:GetPrice=GetPrice.getInstance(); GetPrice.itemPrice=4.43; GetPrice.itemNumber=2; var fp2:Number=Number(GetPrice.simplePrice()); Implementationpublic static function get itemPrice():Spritepublic static function set itemPrice(value:Number):void |
|
newItemPrice
property
newItemPrice:Number [read-write] When another item price is added to add up to the total price. Default value is 0. EXAMPLE: import biz.flashscript.shoppingcart.GetPrice; var gp:GetPrice = GetPrice.getInstance(); GetPrice.itemPrice = 20; GetPrice.itemNumber = 5; var fp1:Number = Number(GetPrice.simplePrice()); GetPrice.itemPrice = 4.43; GetPrice.itemNumber = 2; var fp2:Number = Number(GetPrice.simplePrice()); GetPrice.itemPrice = fp1; GetPrice.newItemPrice = fp2; var fp3:Number = Number(GetPrice.addPrice()); trace (fp3);//trace is 108.86 Implementationpublic static function get newItemPrice():Numberpublic static function set newItemPrice(value:Number):void |
|
itemNumber
property
itemNumber:int [read-write] Sets the number of an item. The default value is 0. .Implementationpublic static function get itemNumber():intpublic static function set itemNumber(value:int):void |
|
shipHandling
property
shipHandling:Number [read-write] Sets the shipping and handling value. The default value is 0. EXAMPLE: import biz.flashscript.shoppingcart.GetPrice; var gp:GetPrice = GetPrice.getInstance(); GetPrice.itemPrice = 20; GetPrice.itemNumber = 5; var textfp1:String = GetPrice.simplePrice(); GetPrice.noTaxPrice = textfp1; GetPrice.shipHandling = 10; trace(GetPrice.addTax());//trace is 110 Implementationpublic static function get shipHandling():Numberpublic static function set shipHandling(value:Number):void |
|
noTaxPrice
property
noTaxPrice:Number [read-write] Sets the price before tax and shipping and handling. The default value is 0. EXAMPLE: import biz.flashscript.shoppingcart.GetPrice; var gp:GetPrice = GetPrice.getInstance(); GetPrice.itemPrice = 20; GetPrice.itemNumber = 5; var textfp1:String = GetPrice.simplePrice(); GetPrice.noTaxPrice = textfp1; GetPrice.stateTax = 7.25; GetPrice.shipHandling = 10; trace(GetPrice.addTax());//trace is 117.25 Implementationpublic static function get shipHandling():Numberpublic static function set shipHandling(value:Number):void |
|
stateTax
property
stateTax:Number [read-write] Is the state tax in per cent used with the addTax() method. The default value is 0. Implementationpublic static function get stateTax():Numberpublic static function set stateTax(value:Number):void |
|
rawPrice
property
rawPrice:Number [read-write] Is the state tax in per cent used with the addTax() method. The default value is 0. EXAMPLE: import biz.flashscript.shoppingcart.GetPrice; var gp:GetPrice = GetPrice.getInstance(); GetPrice.rawPrice=87.45345; trace(GetPrice.adjustRawPrice());//trace is 87.45 Implementationpublic static function get rawPrice():Numberpublic static function set rawPrice(value:Number):void |
| Constructor Detail |
|---|
|
GetPrice () Constructor
public function GetPrice(mp:MakePrivate) |
| To initialize an instance use GetPrice.getInstance(). |
| Method Detail |
|---|
|
addTax():String
Function returns the price total price including tax. This function uses the noTaxPrice and optional stateTax and/or shipHandling values. |
|
addPrice():String
Function returns the price after another item price has been added to the subtotal price. This function uses the values from the variables itemPrice and newItemPrice and sums them up. |
|
adjustRawPrice():String
Function returns the price adjusted to two values after the comma. The function uses the rawPrice variable. |
|
simplePrice():String
Function returns the price of an item multiplied with its number. The function uses the itemNumber and itemPrice variables. |
|
subtractPrice():String
Function returns the price after an item price has been subtracted from the subtotal price. The function subtracts the value of newItemPrice from the value of itemPrice. |