A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: How to transfer variables from one swf to another swf?

  1. #1
    Junior Member
    Join Date
    Sep 2000
    Posts
    18
    I make a game which has a score counter. And I am now working on developing the game to a 100-stage-game. To reduce the loading time, I divide it into ten swf files, each file contains 10 stages.
    But now I am facing some problems. One is that I cannot transfer the variable "score" to another swf file. That means I have to start from zero every time I progress to other stage. Of course, this is unacceptable.
    I use load movie command to do the trick. Could any people help me with this?

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    263
    wingyellow,

    Put the variable that you use to keep score,
    on level 0

    Set Variable: "/:score" = 0

    and when you update it form any of the
    loaded movies use the path /:

    Set Variable: "/:score" = /:score + 1


    Hope this is what you are looking for.
    MA

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