3 Replies Latest reply on Dec 7, 2006 8:25 PM by kglad

    variable help

    jay_gee
      hi all,

      im new to the forum so please go easy on me :-).

      i am currently in the process of creating a flash game and have towards the end of my project except i am having one major problem....

      i have a variable called "score".
      once the game has ended this variable is displayed showing the user the points they scored. They are then prompted to click a button which when clicked plays the next frame in the timeline where the scoreboard is held. The scoreboard is a movieclip held in a 7 frames.

      The problem is how do I get the variable "score" to be passed into the movieclip? or how do I get the movieclip to pull that variable into itself? The variable "score" is used to connect to MS Access database using ASP coding. But i just cant seem to get the variable to carry into the movie clip in question.

      Can anyone suggest perhaps what I am doing wrong?

      I hope I have made sense....

      Thanks
      J
        • 1. Re: variable help
          kglad Adobe Community Professional & MVP
          if score is defined on your main (or _root timeline) and your scroreboard movieclip is on the _root timeline then, from your scoreboard movieclip (and everywhere else in your _level0 swf) you can access:

          _root.score.
          • 2. Re: variable help
            jay_gee Level 1
            thanks for your response.

            i have tried that. where do i define the _root.score? in the main timeline or in the movieclip? what function/command would pull this variable into the movieclip ie do i need to define it in the on (release) bit of the button?

            sorry if im being dumb but im new to actionscripting.

            thanks
            J
            • 3. Re: variable help
              kglad Adobe Community Professional & MVP
              you already have a score variable defined on some timeline. if you're not sure which timeline you can attach trace(this) to a frame of that timeline and you will see the path/name of the timeline that contains the trace(this) function (and your score variable).

              prefixing score with the path displayed in your output panel will allow you to access score from anywhere in your _level0 swf. reference it whereever and whenever you need it.