dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Help: Can Flash MX detect number of files in directory?

  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    6
    I need to know if there's a way to detect the number of files in a directory from inside Flash MX. Advanced actionscript is welcome, as is any help.

    thanks

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    266

    fraid not

    Hi,

    This can't be done with MX alone.

    If your movie is to be played over the internet, you can use a server side scripting language (PHP, ASP, Perl etc) to do this pretty easily.

    Regards,

    Dan.

  3. #3
    Danny Gomez Creations cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    Maybe if the files have the same name but different numbers you can make an experiment.

    var noMoreFiles=false;
    fileAmount=0;
    i=1;
    while (noMoreFiles==false){
    loadMovie("file"+i+".jpg",_root.invisibleHolderMC) ;
    if(getBytesTotal<=0){
    noMoreFiles=true;
    }else{
    fileAmount++;
    }
    i++;
    }
    trace(fileAmount);

  4. #4
    Danny Gomez Creations cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    ops, i think the chances of getting this to works are non with the above if. Maybe it can work like with this if:
    if(_root.invisibleHolderMc.getBytesTotal< maxByte){


    //were maxByte is the least size of bytes that you expect the each file to contain.

    /cheers

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