A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: movie loading...

  1. #1
    Junior Member
    Join Date
    Jun 2000
    Posts
    23
    Hi all,

    I've got a question about loading movies which I hope some-one can answer for me.

    I have got a directory full of .swf files. When my page starts playing, I want flash to choose a random movie clip to preload and then play it. The movies are called m1.swf, m2.swf and so on.

    The only thing I need (I think) is the code to generate a number that replaces the different numbers, and then load that specific movie.
    Something like:

    variable"random_number" & (Random(3))
    load movie ("m(random_number).swf",1)

    thanks for any help you can give me.
    Erwin

  2. #2
    Junior Member
    Join Date
    Jun 2000
    Posts
    7
    Hello Erwin,

    try this out:

    load movie ("m"&random_number&".swf",1)

    be shure to make the command an expression (=) not a string-literal (abc)
    [Edited by bibabutzemann on 06-27-2000 at 09:15 AM]

  3. #3
    Member
    Join Date
    Mar 2000
    Posts
    91
    Hmmmm...Not quite.

    Since you don't have a file beginning with '0', but instead '1', you must increment every random number by 1.

    Here's the code you should use (replace # with the number of different files you have):

    Set Variable: "i" = Random (#)+1
    Load Movie ("bg"&i&".swf",1)

    I used this for 9 different random backgrounds for my new site: http://torraywallace.com

    If you cannot get to it that's because the Apache server will be down for a while. The site is under construction...

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