Professional Web Applications Themes

Calculation - Macromedia Flash Data Integration

Hi, I'm trying to take data from my database and add them (like field 1 + field 2). Somehow, it doesn't seem to be working. Anybody would know a tutorial about it. Just in case somebody would like to check out, this is that last version of the code I came up with: function getmanhours() { var monday=_root.application.hidden.mondayt.text; var tuesday=_root.application.hidden.tuesdayt.text; var wednesday=_root.application.hidden.wednesdayt.text ; var thursday:LoadVars=_root.application.hidden.thursda yt.text; var friday:LoadVars=_root.application.hidden.fridayt.t ext; var saturday:LoadVars=_root.application.hidden.saturda yt.text; var sunday:LoadVars=_root.application.hidden.sundayt.t ext; week_sum = Number (monday) + Number (tuesday)+ Number(wednesday)+ Number(thursday) + Number(friday) + Number(saturday) + Number(sunday); return week_sum; trace (week_sum);} The idea was to send the ...

  1. #1

    Default Calculation

    Hi,

    I'm trying to take data from my database and add them (like field 1 + field 2).
    Somehow, it doesn't seem to be working.
    Anybody would know a tutorial about it.

    Just in case somebody would like to check out, this is that last version of
    the code I came up with:

    function getmanhours() {
    var monday=_root.application.hidden.mondayt.text;
    var tuesday=_root.application.hidden.tuesdayt.text;
    var wednesday=_root.application.hidden.wednesdayt.text ;
    var thursday:LoadVars=_root.application.hidden.thursda yt.text;
    var friday:LoadVars=_root.application.hidden.fridayt.t ext;
    var saturday:LoadVars=_root.application.hidden.saturda yt.text;
    var sunday:LoadVars=_root.application.hidden.sundayt.t ext;

    week_sum = Number (monday) + Number (tuesday)+ Number(wednesday)+
    Number(thursday) +
    Number(friday) + Number(saturday) + Number(sunday);
    return week_sum;
    trace (week_sum);}

    The idea was to send the data into "label" components and use that for the
    calculation, I've been trying this technique to send variables out of flash and
    it worked... not this time.

    Thanks
    Kryss

    Kryss2099 Guest

  2. #2

    Default Re: Calculation

    Why is monday - wednesday variables untyped variables and thursday to sunday
    LoadVars objects?

    var wednesday=_root.application.hidden.wednesdayt.text ;
    var thursday:LoadVars=_root.application.hidden.thursda yt.text;

    For thursday to sunday you cannot assign a String and you should be seeing
    this error message in the output window

    "Type mismatch in assignment statement: found String where LoadVars is
    required."



    --
    Lon Hosford
    [url]www.lonhosford.com[/url]
    May many happy bits flow your way!
    "Kryss2099" <webforumsusermacromedia.com> wrote in message
    news:e10ht4$28l$1forums.macromedia.com...
    Hi,

    I'm trying to take data from my database and add them (like field 1 + field
    2).
    Somehow, it doesn't seem to be working.
    Anybody would know a tutorial about it.

    Just in case somebody would like to check out, this is that last version of
    the code I came up with:

    function getmanhours() {
    var monday=_root.application.hidden.mondayt.text;
    var tuesday=_root.application.hidden.tuesdayt.text;
    var wednesday=_root.application.hidden.wednesdayt.text ;
    var thursday:LoadVars=_root.application.hidden.thursda yt.text;
    var friday:LoadVars=_root.application.hidden.fridayt.t ext;
    var saturday:LoadVars=_root.application.hidden.saturda yt.text;
    var sunday:LoadVars=_root.application.hidden.sundayt.t ext;

    week_sum = Number (monday) + Number (tuesday)+ Number(wednesday)+
    Number(thursday) +
    Number(friday) + Number(saturday) + Number(sunday);
    return week_sum;
    trace (week_sum);}

    The idea was to send the data into "label" components and use that for the
    calculation, I've been trying this technique to send variables out of flash
    and
    it worked... not this time.

    Thanks
    Kryss


    Motion Maker Guest

  3. #3

    Default Re: Calculation

    Hi,

    Thanks for your reply.
    Sorry for the "loadvars" thing mistake.
    It did not bring any errors screen though.

    I still haven't find a toturial about this, nor can I understand why it
    doesn't work this way.

    Thanks
    Kryss

    Kryss2099 Guest

  4. #4

    Default Re: Calculation

    Receiving no errors might have to do with which Flash authoring tool
    version. I pasted the code into Flash 8 and got errors. Still it shows a
    rudimentary understanding of coding rules and how to debug. Perhaps some
    basic training in Flash Actionscripting is in order.

    As far as looking for help you need to identify:

    1. Do you want to use URL vars or XML as the data structure. The LoadVars in
    your code sample implies you want to use URL vars.
    2. What server side scripting language? ASP, ASP.Net, PHP, Perl, Java,
    Javascript, ColdFusion, .....
    3. What database software? Access, mySQL, MS SQL, Oracle.

    Flash really does not care about #2 or #3. But #1 does matter.

    Though not a tutorial, you can look at this example I use in Flash seminars
    that for question 1 is XML, question 2 PHP and question 3 mySQL.

    [url]http://www.hosfordusa.com/ClickSystems/courses/flash/examples/XMLPHPMySql/Ex01/XMLPHPMySQLEx01_Doc.php[/url]


    --
    Lon Hosford
    [url]www.lonhosford.com[/url]
    May many happy bits flow your way!
    "Kryss2099" <webforumsusermacromedia.com> wrote in message
    news:e12l1l$j7$1forums.macromedia.com...
    Hi,

    Thanks for your reply.
    Sorry for the "loadvars" thing mistake.
    It did not bring any errors screen though.

    I still haven't find a toturial about this, nor can I understand why it
    doesn't work this way.

    Thanks
    Kryss


    Motion Maker Guest

Similar Threads

  1. Interest calculation
    By Allan in forum Macromedia Flash
    Replies: 1
    Last Post: August 11th, 06:56 PM
  2. Calculation based on calculation
    By Point_Man@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 20th, 03:35 AM
  3. Doing a simple calculation?
    By Joe in forum Macromedia Director Basics
    Replies: 1
    Last Post: December 7th, 07:25 PM
  4. Calculation problems
    By k9underdog webforumsuser@macromedia.com in forum Macromedia Director Lingo
    Replies: 4
    Last Post: October 28th, 06:17 PM
  5. Calculation Help
    By Heidi in forum Microsoft Access
    Replies: 1
    Last Post: July 17th, 09:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139