User Tag List

Results 1 to 5 of 5

Thread: can I pick a random file?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jun 2007
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    can I pick a random file?

    how can I pick a random file from a folder?

    I would like to select say, a random text file from a folder full of text files (or perhaps an .ini)

    Thanx

    Dave

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: can I pick a random file?

    You'd first need to get a list of files from the folder matching your criteria (.txt extension or .ini extension). Without MMF2 in front of me this is the step I'm not sure about - perhaps some others can make some recommendations.

    I'd then put this list of possible files into a List object, then use the random function to retrieve a random line from this list and use it as the filename. Something like:

    INI: Set file to List Line$("List object", random(List Nb Lines("List object"))

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: can I pick a random file?

    The list object has a function for getting a list of files, funnily enough.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: can I pick a random file?

    The action is "Load file list from C:\MyDirectory\*.txt" (you could use a different extension or *.*).

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleSWF Export Module

    Join Date
    Jun 2007
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: can I pick a random file?

    thanx!

    I don't know how I overlooked that loadfile list item

    from there I get it...



Similar Threads

  1. Pick Random but delete from possible list?
    By EdibleWare in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th October 2013, 10:06 PM
  2. How can I pick a random sound???
    By Oliver in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 5th October 2011, 05:03 PM
  3. Pick Random Object From a Zone.
    By 00J in forum File Archive
    Replies: 0
    Last Post: 28th December 2007, 07:27 AM
  4. Pick object at random, among a selected few
    By Popcorn in forum File Archive
    Replies: 1
    Last Post: 6th December 2007, 05:51 PM
  5. Pick an object at random?
    By Clicktastic in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th August 2006, 01:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •