A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Variables from one MC to another

  1. #1
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693

    [F8] Variables from one MC to another

    I'm probably violating a FK rule here, but I posted my problem in the actionscript forum and got no love, no responses! I don't like to venture out of the games section but felt my question better fit in there... anyways, I was wrong. I hope my faith in the games section to help me out will be affirmed. Anyways the question is:

    So i have a timeline with 2 frames, first frame has a movie clip on it called Game, I define a bunch of variables in it, once the game is played it goes to the next frame on the main timeline, called score. How do I go about accessing the variables from movie clip Game in the movie clip Score? I tried _root.Game.variable, I tried _level0.Game.variable nothing seems to work... not sure how to solve this problem. I'm praying I don't need to redefine all the variables to _root.variable so that they can be accessed by both MC's...
    it can be found here. Sorry about posting in multiple places but my question was ignored.

    Thanks in advance,

    ChaseNYC
    mmm signature

  2. #2
    Senior Member ihoss.com's Avatar
    Join Date
    Oct 2004
    Location
    Norway
    Posts
    581
    If the movieclip is not in the second frame, then all the variables are gone. declare a new variable in root and give it the value you want.

  3. #3
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693
    hmmm so maybe a better solution would be to put the score MC on the second frame of the game MC? instead of telling _root.nextFrame() just this.nextFrame()... I get so confused how to structure things to keep them organized...

    thanks,

    ChaseNYC

    edit: thanks so much, now I don't see why no one in actionscript section couldn't have told me that... I guess games is just the most awesomest section.
    mmm signature

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