User Tag List

Results 1 to 7 of 7

Thread: Can a Fastloop run within another Fastloop?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Can a Fastloop run within another Fastloop?

    Hey, folks!

    Broad question: Can a Fastloop run within another Fastloop?

    Specifics of my issue: I have an audio player in which I'm trying to solve a design issue. Suppose that audio tracks stored on an external hard drive are loaded into the audio player and the audio player remembers the directory path of each file so it can reference them consecutive times the audio player is opened. Now suppose that one day you plug in the external hard drive with the audio tracks and that hard drive is assigned a different hard drive letter; now when the audio player is opened, the player cannot find the audio tracks simply because the computer assigned a different drive letter to those files.

    I am working on functionality whereby the audio player substitutes the computer drive letter, then checks if the audio track can be found. If it can't the audio player will delete reference to that audio track; if it finds the file using a different computer drive letter, then it will update that audio track using the new computer drive letter.

    I'm having some difficulty developing a Fastloop which would perform this functionality. I have attached my existing file, and if you open the second frame, it will display the Fastloop "Verifying Playlist Items". But here's a quick summary of what is supposed to happen:

    1.) When the audio player opens, a separate Fastloop acquires the raw letters (without spaces) of each computer drive letter, then saves it to a Global String. (An example would be "acdef".)
    2.) When the Fastloop "Verifying Playlist Items" runs, if the existing file path is not found, then run another Fastloop called "Checking Other Computer Drive Letters." This Fastloop takes each letter, one at a time, from the Global String, then replaces the first letter in the existing directory path, then checks to see if that file exists.
    3.) If that file exists with the revised directory path, then update the directory path with the new path (using the new computer drive letter).
    4.) If after cycling through all the computer drive letters the file path still doesn't exist, then delete that row from the ListView object.

    Alas, I can't seem to design this correctly. I was hoping someone with more experience designing Fastloops might be able to assist me? I would REALLY appreciate it!
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Pineapple's Avatar
    Join Date
    Oct 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never done a fastloop within a fastloop, but I know you can end the current loop and start a different loop from within a fastloop.

    something like this:
    On loop "loop1", condition has been met: end "loop1", start "loop2" 10 times

    And if you needed to do more with loop 1, just have loop 2 terminate and restart loop 1.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't have time to look at your MFA, but yes, you can run a fastloop from a fastloop, and you still get the guarantee that the "Start loop" action won't finish until after the last "On loop" condition. Without this fastloops wouldn't be nearly as useful.

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You can have a fastloop inside a fastloop inside a fastloop inside another fastloop if you want.

    I use nested fast loops pretty often when working with grids... For example you can generate things along an X/Y grid by first running a fastloop along the X and then running a fastloop inside that for the Y. That will go through the grid one X at a time and through all of the Y each time.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question New iteration of Fastloop in a Fastloop

    I have attached a new iteration that still doesn't work correctly, but which offers some diagnostic information to hint what may be going wrong. In this iteration, I have an Edit box which, each time the internal (second) Fastloop changes drive letters, it captures the drive letter and the original file path (of the file being sought), then saves it to a text file named "<Loop Number for first Fastloop> <Loop Number for second Fastloop>.txt." When I test, I learn the following things:

    1.) The two Fastloops are indeed working properly together, in that the text file output shows <number of computer drive letters> loops each time a single "first" Fastloop runs.
    2.) When I open each text file, I see that the appropriate drive letter is being used to check each iteration for the appropriate "original" file path.
    3.) If an existing file exists in a different drive location, the application properly finds that file, then updates the player list with the new directory path. However, when it does this, I get an Windows error each time it checks for a directory path that doesn't exist. (Is there any way to suppress this error message?)
    4.) If an existing file does not exist in a different drive location, then only every other file reference is removed from the player playlist.


    So, I am making progress. The biggest issue is why only every other file reference is removed from the playlist? Also, is there a way in which the Windows error message can be suppressed, so that the end user doesn't have to click "Continue" each time the application checks for a file in a path that doesn't exist?
    Attached files Attached files

  6. #6
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,546
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Think of fast loops like functions in other languages- you can call one from inside another function, and it will read that whole functions and do it and then return to the current one. So you can call one fastloop from inside another, and that 2nd loop will finish, then return to where you were in the 1st one. But even moreso- you can call a loop from itself, creating recursion. But you have to be careful to logically limit it so it doesn't infinitely stack up recursions.

    However as far as file object actions, I'm no expert

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export Module
    ChrisBurrows's Avatar
    Join Date
    May 2011
    Location
    Tasmania, Australia
    Posts
    622
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I can't open you mfa because I don't have all the extensions. Could you please upload the CS Bouton object?

Similar Threads

  1. Fastloop Issue
    By Teh_Purple_d00d in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 19th September 2011, 08:08 PM
  2. trying to loop a fastloop
    By willy in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 31st May 2008, 08:21 PM
  3. fastloop help
    By falkon in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th April 2008, 11:14 PM
  4. Fastloop bullets example
    By DavidN in forum File Archive
    Replies: 3
    Last Post: 22nd April 2007, 12:13 AM
  5. Bug: Fastloop
    By Sphax in forum File Archive
    Replies: 7
    Last Post: 15th November 2006, 11:36 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
  •