A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: keep a variable where.

  1. #1
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127
    I know a variable is local to the mc its in or expressed /:variable it can be set in the maintimeline.

    If clipA contains clipB, can clipB check a variable in clipA. If so how do I express the location of that variable?
    mark

  2. #2
    Junior Member
    Join Date
    Jul 2000
    Posts
    9
    Originally posted by mgason
    I know a variable is local to the mc its in or expressed /:variable it can be set in the maintimeline.

    If clipA contains clipB, can clipB check a variable in clipA. If so how do I express the location of that variable?
    mark
    Well, usually you if you want to set up a variable in the main timeline you'd write the code in like "_root.variable = 0;" where "0" would be a numerical value to the variable named "variable". If you're in a movie clip and want to write in the path to a variable that's contained in the movie clip one level above, i.e. the parent movie clip, you can do a) use the code "_parent.variableName = 0;" to set the variable "variableName" to the numerical value 0; or, b) you could address it with an absolute path, i.e. "_root.clipA.varibleName" ...

    Hope this helps!

    cheers!

  3. #3
    Senior Member
    Join Date
    Apr 2000
    Location
    Minneapolis
    Posts
    2,127
    Thanks
    root.variable is the new flash5 way of expressing /:variable yeah?
    guess I better change my ways

    _parent seems to be what I was looking for

    thanks again

  4. #4
    Junior Member
    Join Date
    Jul 2000
    Posts
    9
    no prob...

    anytime!

    cheers!

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