Solved

Basic Look up!

Posted on 2004-09-10
13
200 Views
Last Modified: 2010-04-03
I have an excel speadsheet with 4 colums.  First is sales price and the other three are fees.  I have created an interactive CD that runs locally on the clients machine however I would like to create a look up that the client can enter a sales price and have the three amounts returned.  Is this possible in Flash and if so....HOW?


Jim
0
Comment
Question by:liv4fun
13 Comments
 
LVL 1

Expert Comment

by:Aramysm
ID: 12031742
Sure ... but you'd have to place those numbers in an array in flash then loop through the array and return the values if the value they entered is valid ... A better way would simply be to just perform the calculations in flash if such a relationship between the numbers exists (i.e. column 3 = column 2 + column 1).
0
 

Author Comment

by:liv4fun
ID: 12031829
I am a total newbie here!  What do you mean loop them through an array?  There is no relationship between the numbers.

Something like this is what I want.  The client enters the sales price and the Title Fee and the Escrow Fee are automatically filled in off of the table.
        Sale price                                    Title Fee                 Escrow Fee
      $268,000.00                                  $ 1,365.00                $ 525.00


table

price                                      title                                     escrow
0-100,000                             $1,000                                  $ 450
101,000 - 200,000                 $1,230                                  $ 500
201,000 - 300,000                 $1,365                                  $ 525
301,000 - 400,000                 $1,434                                  $ 612
0
 
LVL 1

Expert Comment

by:Aramysm
ID: 12032019
Ah ok ... if that is the whole table then the answer is easier don't worry about an array create 4 textboxes 1 input 3 dynamic in flash.  Create a button and label it say "Calculate".  Name the textboxes accordingly where it says "var" in the properties panel in Flash.  
Name the "var" field on the input Price box "price"
Name the "var" field on the dynamic Title Fee box "fee"
Name the "var field on the dynamic Escrow Fee box "escrow"
Name the "var" field on the dynamic Error box "error"

Drag a button from the UI dropdown in the components list (or create one from scratch if you know how) rename it in the parameters tab of the properties panel and in the actions panel for the calculate button copy and paste this code:

on(release) {
      if (_root.price > 0 && _root.price <= 100000) {
      _root.fee = "$1,000"
      _root.escrow = "$450"
      }else if(_root.price > 100000 && _root.price <= 200000) {
      _root.fee = "$1,230"
      _root.escrow = "$500"
      }else if(_root.price > 200000 && _root.price <= 300000) {
      _root.fee = "$1,365"
      _root.escrow = "$525"
      }else if(_root.price > 300000 && _root.price <= 400000) {
      _root.fee = "$1,434"
      _root.escrow = "$612"
      }else{
        _root.error = "Please enter a value greater than 0 and less than 400,000";
      }
}
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:liv4fun
ID: 12032037
Oh that makes perfect sense...

Quick question though.  Is there a way to export those values in?  My list is about 300 entries long.
0
 
LVL 1

Expert Comment

by:Aramysm
ID: 12032137
AH that's the catch ... well using this method for that many records you'd be better off using XML and looping through the records
0
 

Author Comment

by:liv4fun
ID: 12032323
Okay then how is that done???
0
 
LVL 4

Expert Comment

by:mrdilliard
ID: 12034709
I believe there's a "save as" option in excel where you can export or save as xml. As far as actually reading the file, you'll have to do something similar to this question:

http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_21107750.html

Have fun!
0
 
LVL 7

Expert Comment

by:ssdesign
ID: 12042392
I discovered a Macro that can export XML from Excel.

Its a great macro and gives perfect XML output from use in Flash.

Here is the link:
http://www.codeproject.com/useritems/xls2xml.asp

[You will have to be a registered user to DOWNLOAD the code files.]

I still have one question:

Is the excel file is going to be EDITABLE by the end user? If so, then the user will have to genereate the XML everytime they change the data in the excel.

If the excel is not oging to be editable then you only ned to give the XML file along with the CDROM.

If you have any doubts about how to use this generated XML fo create your Flash file then please feel free to ask.

note: There is no way you can directly read Excel data into Flash if this is going to be a CDROM based project. If you have a web based project, then you can use server side scripts to convert EXCEL to XML on the fly.
0
 

Author Comment

by:liv4fun
ID: 12049986
I have no idea how to use the generator.  And no the data is not editable.  I think I am in over my head on this one.  When it comes to graffics and things like that I can kick ass but this one I am just in too deep.  If you know how to do this I would gladly pay you to whip out just a little search thing in Flash that searches the XML.  I can send you the database.
0
 
LVL 1

Expert Comment

by:Aramysm
ID: 12050103
sure I'll whip it out ... when do you need it by?
0
 

Author Comment

by:liv4fun
ID: 12050118
Don't laugh too hard but tomorrow or at the latest Wednesday morning!

Where should I send you the Excel file and A basic layout of what I want?
0
 
LVL 1

Accepted Solution

by:
Aramysm earned 500 total points
ID: 12050127
hmmm .... I'll try by tomorrow email me at aramys(AT)gmail(DOT)com
0
 

Author Comment

by:liv4fun
ID: 12050282
The files are on the way!  my email is jimadams@firstam.com
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question