dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Random Load Movie

  1. #1

    Random Load Movie

    Hi,

    I am creating a quick quiz in flash for a client, The problem i am having is I want the file to sit localy on the clients PC and connect to my server to display the swf files. This I can do ! But I also want the local swf file to randomly pick a swf file from my server ? This I cant do?

    Is there a way to randomly load swf files into a movie ?

    If so can you tell me how ?


    Cheers

    David

  2. #2
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    Use an array:

    Code:
    randomClips = new Array ("movie0.swf", "movie1.swf", "movie2.swf", "movie3.swf");
    function randomMovie() {
    	randomNumber = random (randomClips.length);
    	_root.mtClip.loadMovie (randomClips[randomNumber]);
    }
    randomMovie();
    The more movies in the array, the more random it is.

    I don't think keeping one movie on one server calling other movies from another server is going to work though. Flash has built in protection against that and will probably cause a Sandbox Violation error.
    Last edited by iaskwhy; 05-20-2004 at 02:27 PM.

  3. #3
    Is there another way to load random movies then ?

    Or will I have to just ftp to the clients machine and download all the movies there?

    CONFUSED YOU WILL BE !

  4. #4
    FK's Geezer Mod Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,490
    As I said, flash will cause errors if you try and load flash content from different domains. It's built into the flashplayer to protect peoples flash content from being used by others. I'm sure you have seen or heard of unscrupulous people linking from their site to an image on another persons website? It's bandwidth theft. The Sanbox Violation thing prevents that.

  5. #5
    Senior Member
    Join Date
    Aug 2000
    Posts
    343
    Hi
    How would you make this work "on release" So instead of it loading automatically, everytime someone clicks a button, it would load a random movie?
    Losse

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