A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Till Management System

  1. #1
    Junior Member
    Join Date
    Dec 2012
    Posts
    7

    Till Management System

    Hello.
    I am making a till management system for a coffee shop. I have the different types of products on different frames. I am trying to work out a way to be able to press the buttons for each individual product, and have this add the cost to a virtual cart, i.e. a coffee for £1.
    I have tried to use the actionscript cost = 0, and the buttons will have on(release) } cost+=1 cost.text = cost
    ----------
    While this works adding the costs on that one frame, the actionscript cost=0 does not update on the next frame to show the current cart amount, which has the next set of products and I therefore have no idea how I would keep the current cost of the basket into the next frames and then to the checkout using the current actioncript.
    Any help would be appreciated.

    Using CS4 Professional Actionscript 2

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    Welcome ConnorA

    You have to modify the frame structure of your application.

    PHP Code:
    _global.cost=0
    This might help..


    arkitx

  3. #3
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Welcome ConnorA!
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  4. #4
    Junior Member
    Join Date
    Dec 2012
    Posts
    7
    Hello, I have added the _global.cost to an actionscript layer on this scene. Whenever I press the buttons now it will just display the number 0 regardless of how many times I press the button.
    The actionscript I am using for the buttons are:
    on(release) {
    cost.text=cost ;
    cost+1 ;
    }

    Any further help would be appreciated.

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Try
    PHP Code:
    on (release) {
        
    cost++;
        
    //cost += 1;// or this way
        
    txt.text cost;

    give your text a different name, it seems to clash with variable cost, or change the variable name!!

  6. #6
    Junior Member
    Join Date
    Dec 2012
    Posts
    7
    Brilliant, that did it. Thanks!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center