Groups | Blog | Home
all groups > macromedia flash sitedesign > november 2005 >

macromedia flash sitedesign : Functions


Fototek
11/4/2005 12:00:00 AM
Hi i am trying to make an online store sort of thing and i am pretty sure it
uses a function but i cannot master functions i have been trying for days
looking everywhere i am ready to give up

Can anyone help???
I have made a demo of what it sorta needs to do its simple but the function :(
go here to see http://www.users.on.net/~fototek/function.fla

I really need assistance
If you know how is it possible to modify the function.fla file and email it
too me
contact me and tell me if its possible if its just my function command or the
way i try to display the result then just print it in here for me to copy to
the FLA file!!!

Please no viruses embedded or anything in flash files
Fototek

http://www.users.on.net/~fototek/function.swf
Chip W.
11/4/2005 7:25:01 PM
Hey F,

First off, you can't use "case" as a variable, as it is a reserved keyword in
Actionscript.

case - Description: Keyword; defines a condition for the switch action.

Look up "case" in the AS dictionary for more info.

Switch your variable on your "case" buttons to something like "caseTotal",
drop the "" from around the numbers, "" will define as a string and won't be
calculated because of string declaration. Here's an example for one of your
"case" buttons:

on (release) {
caseTotal = 150;
gotoAndStop(5);
}

Here's a very simple function to calculate your total, which I added to frame
10:

function calcTotal(){
totalS = caseTotal + mbrd;
}
calcTotal();//this line will run the function as soon as entering the frame.

That should get ya started,
~Chipley
AddThis Social Bookmark Button