Using a scene's variable in a movieclip

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akhin
    New Member
    • Feb 2008
    • 2

    Using a scene's variable in a movieclip

    Hi

    First of all I am new to Flash\Actionscr ipt and I am using CS3.
    I have some in main scene and also have some other in one of a movie clip's frames. I want to use a variable declared in main scene , in my movie clip's frame.

    How can I achieve this ?


    Regards,
    Akin
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    #2
    Originally posted by akhin
    Hi

    First of all I am new to Flash\Actionscr ipt and I am using CS3.
    I have some in main scene and also have some other in one of a movie clip's frames. I want to use a variable declared in main scene , in my movie clip's frame.

    How can I achieve this ?


    Regards,
    Akin
    Not to sure what you want. Do you want to make a button to goto the other scene?
    Please explain more clearly. Give me an example please.

    nomad

    Comment

    • akhin
      New Member
      • Feb 2008
      • 2

      #3
      Originally posted by nomad
      Not to sure what you want. Do you want to make a button to goto the other scene?
      Please explain more clearly. Give me an example please.

      nomad
      There is a scene which users control with keyboard. You can accelerate with "up" key. I store speed in a variable.

      What I want to do is displaying speed in a lcd-like movie object. It has a function called "setnumber (...)" so I can set the number on LCD. So I want to pass the speed parameter in main scene to the function in movie object.

      Comment

      • nomad
        Recognized Expert Contributor
        • Mar 2007
        • 664

        #4
        Originally posted by akhin
        There is a scene which users control with keyboard. You can accelerate with "up" key. I store speed in a variable.

        What I want to do is displaying speed in a lcd-like movie object. It has a function called "setnumber (...)" so I can set the number on LCD. So I want to pass the speed parameter in main scene to the function in movie object.
        I have not done this myself...
        But I would do a goggle on ActionScipts key objects.
        I know it will start something like this

        on (keypress "S") {
        action event here;
        }
        on (kepress "D") {
        action event here;
        }

        nomad
        sorry I hope I gave you some help
        A book you might want to look into is "Flash MX 2004 ActionScript Bible by Robert Reinhardt
        or any other Flash that uses ActionScripts.

        Comment

        Working...