How to make a "health bar" ?

Hi, I need a tutorial on how to create a "health bar" - I don't have a better word for it, but my idea is to have a bar (showing hapiness of a pet), and each time you push a button - the pet gains hapiness - and the "health bar" grows. What is this called, and is there a guide I can read telling me how to create such a code?

Hi it's me again - additional question 
So, I figured out how to stop the happybar from growing when it reached 100%. But when I press the CUTE button, it resets, nomatter how happy it is. Why?
Second problem: I want sound to stop from animations when I play a new animation. It works on all, except from my FOOD animation. If I put in my code the sounds stops on the animations that was running before BUT there is no sound on the FOOD animation either. Why?
stop();
//Happy bar
bar.width = 0;
var growValue:Number = 50;
cute_btn.addEventListener(MouseEvent.CLICK, growBar);
mad_btn.addEventListener(MouseEvent.CLICK, growBar);
leg_btn.addEventListener(MouseEvent.CLICK, growBar);
sove_btn.addEventListener(MouseEvent.CLICK, growBar);
function growBar(evt:MouseEvent):void
     bar.width += growValue;
  if(bar.width >= 250)
  bar.width = 250;
  cute_btn.removeEventListener(MouseEvent.CLICK, growBar);
  mad_btn.removeEventListener(MouseEvent.CLICK, growBar);
  leg_btn.removeEventListener(MouseEvent.CLICK, growBar);
  sove_btn.removeEventListener(MouseEvent.CLICK, growBar);
//Cute button
cute_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_1);
function fl_ClickToGoToAndPlayFromFrame_1(event:MouseEvent):void
   gotoAndStop("nuttet");
   nuttet_mc.play();
cute_btn.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds);
function fl_ClickToStopAllSounds(event:MouseEvent):void
SoundMixer.stopAll();
//Play button
leg_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_2);
function fl_ClickToGoToAndPlayFromFrame_2(event:MouseEvent):void
   gotoAndStop("leg");
   leg_mc.play();
leg_btn.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds_2);
function fl_ClickToStopAllSounds_2(event:MouseEvent):void
SoundMixer.stopAll();
//Food button
mad_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_10);
function fl_ClickToGoToAndPlayFromFrame_10(event:MouseEvent):void
gotoAndStop("mad");
mad_mc.play();
/*mad_btn.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds_3);
function fl_ClickToStopAllSounds_3(event:MouseEvent):void
SoundMixer.stopAll();
//Sleep button
sove_btn.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_11);
function fl_ClickToGoToAndPlayFromFrame_11(event:MouseEvent):void
gotoAndStop("sove");
sove_mc.play();
sove_btn.addEventListener(MouseEvent.CLICK, fl_ClickToStopAllSounds_2);
function fl_ClickToStopAllSounds_4(event:MouseEvent):void
SoundMixer.stopAll();

Similar Messages

  • Is their any tutorials on how to make a navigation bar with drop downs in Dreamweaver CC now ?

    Is their any tutorials on how to make a navigation bar with drop downs in Dreamweaver CC now that they do not have the spry option?

    bbull2005 wrote:
    Preran, why wouldn't Dreamweaver include it's own menu/navigation bar widget?
    I can't answer on Preran's or Adobe's behalf, but I think you'll find at least part of the answer here: http://wiki.jqueryui.com/w/page/38666403/Menubar
    Adobe decided to discontinue development of Spry in August last year, and Dreamweaver CC made the switch to using jQuery UI widgets and effects. One reason for dropping Spry was that it failed to work correctly in some browsers. Judging from the fact that the jQuery UI menubar is now "on ice", creating a flyout menu that works reliably across all devices is proving more difficult than originally envisaged.
    Because all other widgets in Dreamweaver CC use jQuery UI, it's a reasonable assumption that Adobe hoped the jQuery UI menubar would be ready in time, but it wasn't.

  • How to make a scroll bar!!!

    i need to know how to make a scroll bar in flash cs3! can
    anyone help me with this??

    http://learnola.com/2008/10/27/flash-tutorial-create-a-custom-scrollbar-with-actionscript/

  • How to make a slide bar that controls opacity

    I'm trying to figure out how to make a slide bar that would control opacity. If I were to take to pictures on top of each other, the slide bar would control the opasity of the top image. Thanks

    can you make a slider that controls anything?  if so, what's the range you can control?
    ie, when the slider is at one extreme it causes some object to have value1 and when it's at the other extreme the object has value2.  what value1, value2 can you handle?

  • How to make a navigation bar with buttons that stay highlighted

    I have Dreamweaver MX 2004. I know how to make a simple nav
    bar, but how do you make it so it's like the Apple website, with
    buttons that stay highlighted on the appropriate page?

    "[email protected]" <[email protected]>
    wrote in message
    news:gd04sb$5mc$[email protected]..
    >I have Dreamweaver MX 2004. I know how to make a simple
    nav bar, but how
    >do you make it so it's like the Apple website, with
    buttons that stay
    >highlighted on the appropriate page?
    http://divahtml.com/products/divaGPS/current_menu_location.php
    Thierry
    http://www.TJKDesign.com/go/?0
    | Articles and Tutorials
    http://divahtml.com/products/scripts_dreamweaver_extensions.php
    | Extensions
    that keep your markup clean
    http://www.fourlevel.com/ |
    CSS Menus, Gallery, Tab Panels, etc

  • How to make the status bar transparent

    can anyone help?

    Here it don`t make the status bar transparent...
    I`m trying to make UINavigationBar transparent too like Photo App and trying it but get nothing:
    [navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent];
    [navigationController.navigationBar setTintColor:[UIColor colorWithWhite:0.2 alpha:0.6]];
    Some other idea how they do this? An application called Style.com do the same..
    Thank you

  • How to make HDivide Box Bars clickable?

    Does anyone know how to make the bars of a HDivide box click
    able so I can collapse or open the children. Basically when clicked
    I want to collapse the bars and change the bar image and then if
    it's closed have it open... Similar to Editing tools in windows
    applications. Any examples or help would be appreciated

    Be sure that you have assigned the button covering the stage
    the instance name "clic"
    Also, to cover all bases, you will be better off to approach
    the code using strict AS3...
    var url:String = "
    http://hartkopfconstruction.com";
    var request:URLRequest = new URLRequest(url);
    function clicked(e:MouseEvent):void{
    navigateToURL(request);
    clic.addEventListener(MouseEvent.CLICK, clicked);
    Sorry, but I don't personally know any good Flash books. I've
    done most of my learning by doing (trying) and searching for
    solutions when I need them. If you search the forum you may find
    some recommendations. I've seen this question a few times.

  • How to make a progress bar or a waitting page?

    page1.cfm
    <form action="InputDB.cfm" method="post">
    <input id="inputdb" type="submit" value="InputNow">
    </form>
    InputDB.cfm
    <cfloop from="1" to "9000000" index="x">
    if it inputs the 9000000 records into the database,
    it will spend a lot of time,how to do make a progress bar
    or a waitting page when Users wait for the time?
    </cfloop>
    Thanks a lot.

    Waiting pages are easy.
    Step 1, convert form variables to session variable.
    Step 2, display something.
    Step 3, use js window.location to call the action page. Don't
    use cflocation. Even though it works, you lose your display.

  • How ro make an Code Bar in Smartforms

    Hello:
    I would like to make one question, i have been trying to make an code Bar into Smartforms, so the question is.
    is it possible make that into smartforms?
    thanks a lot i will really appreciate if somebody know how to do that

    Hi,
    Check these links,
    http://www.zebra.com/id/zebra/na/en/documentlibrary/misc/sap_smart_forms_faqs.File.tmp/SAP_SmartFormsFAQ.pdf&dvar1=null&dvar2=null&dvar3=null
    http://www.servopack.de/Files/HB/ZPLcommands.pdf.
    http://help.sap.com/saphelp_nw04/helpdata/en/d9/4a94c851ea11d189570000e829fbbd/content.htm
    http://www.sap-img.com/abap/questions-about-bar-code-printing-in-sap.htm
    Regards,
    Azaz Ali.

  • How to make a scroll Bar with buttons

    Hi all,
    I am using Flash cs6 on an iMAC running 10.7.2
    I would like to know if anyone could please point me to a tutorial, showing "how to create a scroll bar with buttons". I am having a heck of a time finding a tutorial.
    Many thanks in advance.
    regards,
    DH

    http://learnola.com/2008/10/27/flash-tutorial-create-a-custom-scrollbar-with-actionscript/

  • [SCORE] How to make an unfinished bar at the beginning of a song?

    I'm working on a song and I'm trying to get the score right.
    The song has an unfinished bar in the beginning; the song is in 4/4 but the very first note starts at the 4th count of the first bar. In the score, Logic automatically puts in a breve rest followed by a quarter rest (interpretation is on), but that's not what I want. At the end of the song, the "missed" notes complement the first bar (so it's in fact a 3/4 bar).
    My problem is that I can't look it up in the manual nor internet, because I don't know the proper English word for it (it's called "opmaat" in Dutch). Online dictionaries aren't helping me either... Sorry for that!
    I can of course set the signature of the 1st bar to 1/4 and make the last 3/4, but then you see the signature change as well in the score.I guess there most be another way to make an "opmaat". Does somebody know this?
    Thanks in advance!
    Message was edited by: Jan Voortwist

    {quote:title=Jan Voortwist wrote:}
    Maybe a stupid question,{quote}
    On the contrary ...!
    how do I dedicate a staff style just to the extra region at the beginning of the song?
    1 - Do you have a region that starts at the very beginning of the Track? Say bar 1?
    2 - Assuming you have a region starting from the very beginning of the song. Cut that existing region at the Right Hand point where you want your 'extra region at the beginning of the song' to end. This should now fit exactly to the rest of the Region on that Track, and when you open the Score Editor there will be a continuous stave of music.
    3 - This now can be treated as a discrete Region in its own right. Open the Score Editor on that Region and change the Staff style by going to Layout>Staff Styles
    4 - Click on New and a menu will open with a list - from that list select Duplicate - this will give you the same Staff Style as that instrument that was already on that Track.
    5 - Double Click the name and Type in your own Name ..say *Piano NEW* - then be sure to TAB out of the box.. Logic 8 does not allow you to change the name if you just click somewhere else. You can then make the changes necessary to that Staff Style as per my example ( ie no Rests)
    6 - You will then find that Piano New appears in the list of Staff Styles for use in any other situation.
    HTH

  • How to make growing progress bars in video?

    I am as green as you can get, in fact I do not yet have my editing software, though my first choice is Adobe premiere pro. For future reference could someone please explain to me how I could animate one or multiple progress bars to fill up over the course of a series of videos? I know this can be done as I've seen it before, please help.

    Make 2 bars in Photoshop one 0% and one 100%, place the second one above the first in the timeline and animate it with a linear wipe.

  • How to make a menu bar made is flash cs5 go to an html page

    so i am making a website in Dreamweaver cs5 and i am going to be importing a .swf animation for the menu bar i made in Flash. how do i make an action in Flash direct to a page of my website in Dreamweaver for example the index.html file of my web page.
    right now i have an actions layer with a stop(); command on the last frame of the animation i want to add a command under that, that will take the user to the index.html page of my website when the button is clicked. I have the button already made as well as the animation all i am missing is the code to go to the index.html page.

    in ActionSscript 2 it would be something like:
    myButton.onRelease = function(){
      getURL("http://mywebsite.dk", "_parent");
    in AactionScript 3.0 it would be something like:
    myButton.addEventListener(MouseEvent.CLICK, onButtonClick, false, 0, true);
    function onButtonClick(e:MouseEvent):void
      var url:String = "http://mywebsite.dk";
      var request:URLRequest = new URLRequest(url);
      navigateToURL(request);
    See if some of that, does the trick for you.
    /ockley

  • How to make a navigation bar overlap a banner image

    Whilst trying to code a website for a class project, I came across an issue. I would like to have my nagigation bar overlap my banner image, like you can see on this webpage http://blindbarber.com/ and I was wondering how I would go about doing that. I'm not even sure where to start with doing it, as every time i attempt to make it work, all it does is push the rest of the webpage down.
    I'm using Dreamweaver CS4, and if you need to see any of my code, just let me know
    Thanks in advance

    Without getting into all the effects used on the site you linked above, simply create your menu container and apply an overall  background image behind your menu with CSS
    background: #fcf url(images/menubg.jpg);
    If on the other hand, you want images within your menu itself, this tutorial is particularly helpful in showing exacly where to apply the images.
    http://etuts.org/add-background-image-color-to-thesis-navigation-menu/
    And yes, seeing your code is invaluable, and by far the best way to do this is to upload your work on a server,
    We usually need to see ALL your files to solve your issue quickly and accurately without a lot of guessing and questions back-and-forth.
    Just rename a copy of your problem page  (such as "test.html")  and upload it to your server (with any associated files) in whatever folder the original page was located, and simply post a link in the Forum and tell us your problem.
    This saves you having to cut and paste miles of code into the Forum for the page and all the dependent CSS, JS etc. files.and saves us from having to recreate all your files, find your images and then repair your code and test the solution for you.
    I trust this is helpful.

  • How to make the scroll bar in flex automate to focus on the new ui component added in the canvas?

    Hi all ,
    There is a canvas container where am adding charts in separate windows.
    So whenever a new chart is added the scroll bar needs to set the focus on the present chart window.
    For this i made the functionality for the canvas container to scroll whenever a new chart is added using the below code
    canvasContainer.verticalScrollPosition = canvasContainer.maxVerticalScrollPosition;
    But the calculations for the vertical position are not precise...
    Is there anything else I should do to make the scroll happen automatically as the chart windows get added in the container ??
    Any suggestions pls
    Regards,
    Ajantha

    Many many thanks to Frank,
    In the css,use the follwing style settings to hide the scroll bar
    af|carousel::spin-bar{    
    visibility: hidden;
    af|carousel::spin-h-previous-icon-style{
    visibility: hidden;
    af|carousel::spin-h-next-icon-style{
    visibility: hidden;
    af|carousel::spin-info{
    visibility: hidden;
    }

Maybe you are looking for

  • Want to create XML tag from the query

    Here i want to create a xml output from the below code for the given P_repair_number can anyone help me for the code i have written ORA-06502: PL/SQL: numeric or value error: character to number conversion error facing the above error when run from c

  • Binding Error when creating a new publication

    Hi i am fairly new to replication. My situation is that I dropped replication using the script that was generated from the publication. When I go through the publication wizard I get a error message on the first page 'New publication Wizard encounter

  • No User SAP* after the creation of a new client

    Hello, I made a system copy from PROD to DEV-System and upgraded the DEV-System to EHP7. Now I want to create a new customizing client but when I create the client in transaction SCC4 there is no user sap* on this client. I never thought this is poss

  • Collect comments on automatic start of reusable workflow

    I want to start a workflow automatically, how can I collect  "comments" (multiple lines of text) metadata from users when they are checking in a document, that should be collected by the workflow?

  • DEBMAS IDOC for CREATE and UPDATE

    How do i use DEBMAS IDOC dynamically for create and update customer information. I have a file as source which would have combination of information for new and change customer information. and there is a field in the file with t code xd01(create) an