A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Small problem please tell me there is a simple solution

  1. #1
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    Small problem please tell me there is a simple solution

    I am very much puzzled. I am building my first very large .exe exported game using 3dfa. I have decided to spit things up into layers for different types of controls. that will show up and leave at different times in the game. these layers include buttons that have script on them but the script does not work. The script can not seem to find variables I have defined in the movie script.

    I have tryed some buttons on a layer that is on a layer and 2 layers deep and it comes up with undefined variable errors. when I move that button to a place where it is not on a layer the script works perfect. So is there a way that I would be able to keep the buttons on layers and have the script work.

    I am puzzled.

    any help would be great.

    the script by the way uses 2 variables one called cash and one called engineid.

    the script is as follows

    if (cash>=1000)
    if (engineid<1)
    {
    engineid=1
    cash-=1000
    }

  2. #2
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    Hi, I don't make a lot of exe stuff butI think it may be because when you try to call a varible form another layer you need to put layer your calling it from in front of it.

    Example. If there is a variable in layer1 and you wana call a variable in layer2 called variable you say...

    layer1.variable

    If you want to call a variale from the main movie you say root.variable.

    Hope this helps.
    BC

  3. #3
    Junior Member
    Join Date
    Mar 2006
    Posts
    19
    Thanks

    I hope that works

    Can't wait to try that tonight

  4. #4
    Game Master ConnELITE's Avatar
    Join Date
    Apr 2005
    Location
    United States, DC
    Posts
    474
    K, If you are still have trouble please post the source in a zip file and I'll see if I can take a look at it for you.
    BC

  5. #5
    Junior Member
    Join Date
    Mar 2006
    Posts
    19

    It worked

    it worked

    Thanks so much

    you have been alot more help than the help menu. I still love using this program.

    Thanks
    Again

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