User Tag List

Results 1 to 10 of 10

Thread: Problem with a global variable

  1. #1
    No Products Registered

    Join Date
    Sep 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with a global variable

    I am having a problem with a global variable, and I cannot seem to de-bug it.
    What I am trying to do is carry a global variable that says if item #1 is owned by player #1, player #2, or nobody.
    When the frame starts I want the variable to equal zero, I even have it set to zero when the game starts, but for some reason it is changing to #1 when the game actual game starts.
    Here is my coding
    If player=1
    ItemNumber=1
    Button clicked...

    Then make item1owner=1

    But it is making the item1owner equal to 1 before the button is clicked, when it should be zero. Any thoughts?

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    Put the "button clicked" condition above the others. It should turn red, which is good. =)

  3. #3
    No Products Registered

    Join Date
    Sep 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    Thank you for the advice, that did seem to fix one problem, the variable does not change before the button is clicked, unfortunately it doesn't change when the button is clicked either.
    It may be something I did , but I can not figure out what it is?

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    That's weird. Can you post your .mfa?

    or maybe snapshot the event that's setting the value.

  5. #5
    No Products Registered

    Join Date
    Sep 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    One frame #4 right before the "game frame"
    I set global value Player Number to one
    I set item1owned to 0
    Itemnumber1 =1
    Playernumber=1

    Frame #5 is the game screen the item1owned is still 0 when the frame starts (I checked this)

    The code in question is this
    If button is clicked
    Itemnumber1 = 1
    Player Number =1

    Then set itemowned1 = 1

    But it just stay set to 0

  6. #6
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,825
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Problem with a global variable

    Can you upload an MFA so we can take a look?

  7. #7
    No Products Registered

    Join Date
    Sep 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    Yes I can do that, if somebody can tell me how to do it?????
    Excuse my ignorance

  8. #8
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    Use the MFA repository to upload and then post the link here.

    There's a link to the repository on the right side of this site, or you can click the link below

    http://mfa.aquadasoft.com/

  9. #9
    No Products Registered

    Join Date
    Sep 2006
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    I tried to upload the file it is to big, I will tinker around with the program and see if I can get the thing to work.

  10. #10
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)iOS Export Module (Steam)

    Join Date
    Jun 2007
    Location
    United States
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem with a global variable

    Most likely you have an event where the value is set to 0. This event might keep looping, so it will reset to 0 even after you set it to 1.

Similar Threads

  1. variable global
    By copperbob in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th February 2012, 08:15 PM
  2. Global variable = alterable variable
    By Jibs in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st November 2011, 08:54 PM
  3. Problem setting a Global Variable to use decimals
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 16th February 2011, 06:29 PM
  4. Global Variable Problems.
    By Worf in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 16th July 2010, 05:20 PM
  5. Timer based on Global Variable
    By Digitalic in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 26th June 2010, 07:29 PM

Posting Permissions

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