Adobe Flash Cs5(Fundraising Thermometer)

Discussion in 'Design and Graphics' started by karmuser, Apr 20, 2011.

  1. karmuser macrumors newbie

    Apr 20, 2011

    I am working for a non profit organisation which raises funds and awareness for 100's of charities but I've got a problem. I need help with the fundraising thermometer where the "total raised" image should scale upwards along with the mercury and the percentage should also update, as I attached the images you can have a look at it. The mercury is increasing but the image is not moving along with the mercury. How I can do that with action script. And if you have any ideas on improving the functionality or design, that would also help.

    Thanks in advance.

    Attached Files:

  2. iSee macrumors 68040


    Oct 25, 2004
    It's hard to give specific advice without code to look at but...

    Put the thing you want to move up in it's own movie clip. Put an instance of the clip on top of the background and mercury. Give the instance a name so you can refer to it in action script. They are different ways you could layer stuff, but start simple and only get more complicated if you have to.

    I assume you have some actionscript already that is correctly scaling the mercury, right? That's where you want to put the script to move the banner. Assign a value to the .y property to move it up and down. E.g. if your instance is called "banner" then banner.y = 100 will move it to position 100.
    Figure out which y position corresponds to 0% and which to 100%. Let's call those two values yfor0 and yfor100. Yuo can then calulate the current .y position for the banner like this:
    banner.y = yfor0 + (yfor100 - yfor0) * percentToTarget;

    Once you've got that working, add a dynamic text field to the banner movie clip. Give it a name, e.g. percentDisplay. Then you can access it in script. E.g.,

    banner.percentDisplay.text = String(percentToTarget * 100) + " %";

    (you probably want to play with rounding to whole number for display)

    Likewise you probably want to create another text field for displaying the $ amount raised.
  3. karmuser, Apr 26, 2011
    Last edited: Apr 26, 2011

    karmuser thread starter macrumors newbie

    Apr 20, 2011
    Fundraising Thermometer


    Thanks for your reply.
    I attached the project and please look into it.
    The images I posted in the thread are just sample one's. Our requirement is "the user creates his own fundraising page with a target say $120, initially the thermometer level is 0% value:0 and when people donates money the thermometer mercury level should increase and values are stored in the database and retrieved when the page loads. So that the thermometer mercury level should increase according to that. Finally, when reached the target it should show the "total raised" target $120 and 100% in the image.

    Thanks in advance,
    Karma User

    Attached Files:

Share This Page