Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ok guys..a project.....unless? 2

Status
Not open for further replies.

coldfused

Technical User
Jan 27, 2001
2,442
US
guys a need a flash movie that will calculate things for me..what i want to do is to be able to input weights and prices..or lengths and prices..and have flash calculate the price and quanity needed for me..now i know i will have to go in and give it the values that i want it to calculate, but i have no idea where to start..

#1..i want a script that i can give the width and height of a room and have flash calculate how much wallpaper for that room..depending on the length of product selected it will tell how many rolls of that product the user will need to paper the whole room..

#2..same thing for let's say, "paint" or "tile" or "whatever"..

old, dave, wang..

anyone up for that challenge?..i really need this..will add some nice finishing touches to a project i'm bringing to a close..

oh and the "unless" part was..unless it's already been done in flash and someone can point me to the link..or if you know where some cgi's or some other "freebies" are that will work as well..i've looked but come up short..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
I'm not very good at maths! Never was! Maybe Wang will come up with something, but he's probably sleeping over on the other side of the Atlantic.

If you could put your hands on what calculations the wallpaper sellers use, when doing this sort of thing, I suppose it would be easy enough to translate into Flash, but I woudn't know where to begin either.

Must be total square footage to be covered divided by what 1 roll (depending on width and lenght of it) covers in square footage. What about openings such as doors and windows and whatever else they take into account!

Regards,
wink4.gif
ldnewbie
 
yeh like i said bro i know what i'm thinking..but have no idea where to start..i am looking up a bunch of free cgi scripts now to see if i can find what i'm looking for that way..doesn't really matter if it flash or not i guess..just really need to find some calculators..i have seen some sights with them on there..but not enough of the source code(some linked pages missing) to figure out how they were communicating back to the data base..

will keep looking..if you find some while your out and about surfing..let me know..thanks..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
sweet...now how do we do that?..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
If you want to use asp...let me know but you could do it in jvScript

What do you want to do with the database exactly??


Have Fun...

Sharky99 >:):O>
 
You don't need to do it! It's already done!
Just link to that site!

Sorry for the humour... I'm tired!

Regards,
wink4.gif
ldnewbie
 
Okay, I'm awake now!

The maths part is easy enough:

per wall:
area=width*height

same for doors, windows etc - work out their area the same way and subtract it from the walls total.

Divide the whole lot by the area of a roll of wallpaper and you should be there.

You'll have to do some conversion of numbers to perform the calculations as Flash doesn't work in feet and inches obviously but it's not a big problem at all.

There's no need for serverside stuff - all of the amounts could be held in arrays. Better still each wall, door etc could be a new Object with height, width and area as properties which would be a really concise and powerful way of making the whole thing work.

Just needs a logical way for user to input the data required. If you need a hand I'll happily write a bit of script.
 
old that link is sweet..but i can't just link to them..they are and will be competetors..sharky can't use asp..linux server..wang..can you have a look at that link old gave abbove..they have five estimators there..they all are what i need..if you want, and have some time..i would greatly appreciate it..maybe just a wallpaper and paint one for now..but the ones on that site are awesome..and no i'm not copying them, i have never seen that site before..the guy who own's the site i'm working on asked me if it could be done in flash..i told him yes, but would have to get some help..is beyond my skills..i've seen some javscript onesbefore..but not done in flash..

anyways wang..if you have some time..
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
I'll see what I can come up with. Shouldn't take too long.
 
Sorry man, haven't had time to put a .fla together (my girlfriend doesn't seem to understand that Flash is important for some strange reason) but here's how I would have done it if I had had time ;-)

We can't work in feet and inches, so we have to convert things to something Flash can deal with. Logically this means we have to break things down into their smallest component part i.e. inches - so we need this function:

function feet2Inches (feet, inches) {
return 12*feet+inches;
}


We need to calculate area - this is easy...

function area (width, height) {
return width*height;
}


...but this is giving us an answer in square inches which isn't particularly useful to the customer so we need to do some conversion back to square feet and round up the spare inches so that we have enough wallpaper to do the job...

function squareFeet (squareInches) {
return Math.ceil(squareInches/144);
}


To keep track of things we need some "running total" variables for items like total wall area, total door area etc.

Basically what you need is a few loops...

Loop 1: wallArea

frame1 -
input how many walls, store this as a variable (wallNum).

frame 2 -
input height and width of wall in feet and inches
call feet2Inches function
call area function

frame 3 -
totalWallArea+=area calculated from previous frame
if loopCount<wallNum goto previous frame (i.e. add another wall)
else go forward and do the same looping process for door/windows etc...

at the end of this you should have variables for totalWallArea, totalDoorArea, totalWindowArea (windows and doors could be held in one variable to be honest - they're just holes in the walls after all :) )

totalWallArea-=(totalDoorArea + totalWindowArea);
call function squareFeet to convert back

divide this result by the square footage of a roll of wallpaper and you'll have how many rolls the job requires.

Put together a .fla of the pages,input boxes and layout that you want to use and we can fill in the code easily enough.
 
ok sweet wang..but what i am going to do is work on my own site for a few weeks..i really need to get it done..possible clients wanting to see it..i'm a few weeks from being done..but after that i will get back to promaintenance4u ..i plan on adding your game that you did (the poll), remember?. and also i will get back to the calculators..but like you suggested i will build the templelets for the calculators and have you walk me through the script..sounds easy for you , but is a learning experience for me!.the site is finished enough to run for a couple weeks the way it is..i'm almost done..just the game and the calculators..a couple other pages i'm gona work different, but that is later down the road..

anyways thanks...and will seek your help on this in a couple weeks..if that is ok?.

ps. my wife hates flash as well! :)
logo.gif


carlsatterwhite@orlandomediasolutions.com
 
Just to throw a spanner into the works----

What about the pattern repeating length of the wallpaper. It is also customary to use a single strip of paper from top to bottom. Your calculations will not account for this.

Sorry for being a git.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top