A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: random position in screensaver

  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    London
    Posts
    122

    random position in screensaver

    Hi, i need to create a screensaver for pc's. basically, i need a flash movie to loop, but everytime it plays it needs to move into a new position.

    cheers

    Also any advice on programs to use for this would be great. I'm using mac os x

  2. #2
    See-n-reMember azwaldo's Avatar
    Join Date
    Mar 2003
    Location
    Sonoran Desert
    Posts
    745
    if you do NOT need the file to run from the OS, like a regular system screen saver, you could create a javascript fxn to randomly assign the window's location (size, whatever). have a look at these pages to see each part of your fxn explained:

    Getting Random
    http://www.pageresource.com/jscript/jrandom.htm

    Put Your Window Where You Want It
    http://www.netmechanic.com/news/vol4/javascript_no7.htm

    place the fxn in the head of an html container document (that holds the .swf), and call the fxn from inside flash when each loop ends, something like
    Code:
    getURL("javascript:myJScriptFxnInMyHtmlHeader()");
    if, however, you want to execute the file from the operating system like a real screen saver, i did find this freeware bit (googled "Flash screen saver tutorial", hit buried on fifth page)
    Last edited by azwaldo; 02-23-2005 at 11:08 PM.
    __azwaldo__

  3. #3
    Senior Member
    Join Date
    Jul 2002
    Posts
    153
    Martin, what program are you going to use to turn your SWF into a screensaver installer? Check that programs' documentation... Programs like that usually have either switches during the building of your screensaver or AS commands you can insert into your movie that will do this.

    Good luck

  4. #4
    Inspector General
    Join Date
    May 2001
    Posts
    493
    i've used this program a bunch of times for widely distributed screensavers:
    http://www.screentime.com/software/stf/

    it is super simple.

    the process is usually create a swf
    convert swf to projector
    use screensaver software that creates an installer which basically is a file that tells the OS to launch your projector whenever the screensaver is supposed to kick in.

    it helps to use fscommands in your original swf to set the projector to run fullscreen. the screensaver programs these days are highly advanced and let you customize a lot of settings post swf production.

    to answer your question about random placement you need to have a movieclip in your main movie that randomly positions itself by placing AS in its last frame like this:

    _root.mcInstance._x=random(Stage.width)
    _root.mcInstance._y=random(Stage.height)

    http://www.doyouhaveapen.com/posting...placement.html
    Last edited by meglomor; 02-26-2005 at 06:29 PM.

  5. #5
    Inspector General
    Join Date
    May 2001
    Posts
    493
    attachment

    ***if you want to make sure the moviclip is always 100% visible on screen, i can show you how to do that too.
    Attached Files Attached Files

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