A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Loading Movies Based on Variables

Hybrid View

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    20
    I am very new to Flash, so I'm quite lost here. I have many .swf files and I need them to "know" where to go when someone presses the forward or backward button. The fwd and bwd buttons are on a lower level and the movies are loaded on top of the navigation. I was thinking that this could be done by having the individual files update a text file and having the bottom (navigation) movie read the variables from this textfile. Am I completely off in this? If I'm not, how do I go about doing this?
    Thanks

  2. #2
    Junior Member
    Join Date
    Sep 2000
    Posts
    18
    No need to work with a txt file. If your next/prev navigation is linear, the easiest wat is to establish an array where the values are the path to the file.

    pageNavigation = new Array();
    pageNavigation[0] = "this.swf";
    pageNavigation[1] = "that.swf";
    ect..

    Wherever you start pagewise (i.e. the first page), set a variable to the array value.

    loadMovieNum(pageNavigation[0], 1);
    currentPage = 0;

    now when you hit next you add 1 (assuming content on level 1).

    loadMovieNum(pageNavigation[currentPage+1], 1);

    now when you hit prev you subtract 1. Once you're comfortable with this. Make some if/else logic to prevent going past the last page or before the first.

    Hope this helps.

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