User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: How does the "Iterate Array" action in the Named Variable object work?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

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

    Question How does the "Iterate Array" action in the Named Variable object work?

    Hey, folks!

    I am trying to perform a function which I suspect is pretty easy to do, but I'm not sure how to do it...

    I have a Named Variable object which has variables that begin with the key string "CustomLoop", then additional characters which describe that loop. When the MMF2 application opens and the array loads into the Named Variable object, I want it to iterate through the array contents, then locate all keys which begin with the string "CustomLoop"; if it finds a key that begins with that string, then I want it to compare the actual string contents of that key and determine if the file which that string represents exists.

    In short:
    1.) Scan through the contents of the Named Variable object, then select keys which begin with the string "CustomLoop."
    2.) If such a key is found, then determine if a file exists which matches that key's string contents.


    How would I do that?

    Thanks for your help, as always!

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Here you go.
    Attached files Attached files
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, LB, you always make it look so easy!

    As always, thanks for your help! I really appreciate it!

  4. #4
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, I thought I was getting the hang of it...

    I have been able to properly set up my actions if the file exists for the iterated key's string contents. But I can't seem to properly set up the one action I need to take place if the file does not exist for the iterated key's string contents. I need the iterated key to be deleted from the array. So, I set up the action "Delete variable" with the expression: IterateKey( "Named variable object" ).

    But when I test, I will remove the target file so that it would not be found, then run the application; the key associated with the target file should be deleted. I shut down the application, put the target file back into place, then run the application again; the key remains, because it is added to a combo box. So, I must not be performing the correct expression to delete that variable.

    What am I doing wrong here?

    Thanks again for your help!

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RGBreality View Post
    I will remove the target file so that it would not be found, then run the application; the key associated with the target file should be deleted.
    OK, so running it without the file deletes it. But the key exists at the start of the app every time, right?

    Quote Originally Posted by RGBreality View Post
    I shut down the application, put the target file back into place, then run the application again; the key remains, because it is added to a combo box.
    Um, what? You put the file back to see if the variable had been deleted, when it only gets deleted if the file isn't there?

    Quote Originally Posted by RGBreality View Post
    So, I must not be performing the correct expression to delete that variable.
    You are, but I think you did the test wrong...

    Quote Originally Posted by RGBreality View Post
    What am I doing wrong here?
    My best guess is that you're checking to see if it gets deleted when the file is in place...?
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, LB!

    Okay, here's the whole story. This particular functionality is for an audio player I have been hobbying around with... There is a selection within a combo box which allows the end user to add any audio file to the audio player and the audio player will automatically loop it endlessly. When the user selects their audio file, the Named Variable object key is created with the name "CustomLoop "+Name_of_File (this is only the file name and file extension--not the entire file path). So, the key isn't there the first time the audio player is run.

    When the application starts, I wanted it to check if (a) there are any custom audio loops set up, and (b) if there are, do the files associated with them still exist in the same directory path. If so, then add the file name (truncated to just the file name and extension) to the combo box so the end user can play their file endlessly. If a custom audio loop has been set up previously (meaning, there is a key), but there is no file associated with it (perhaps the file was deleted), then delete the key from the Named Variable object.

    It is this last part that I'm having problems.

    So, here's my test. I add a file to be played endlessly, and the file properly displays in the combo box. Furthermore, selecting the new combo box option does play the audio file endlessly. So, that's all good. I will then exit the application, then rename the target file (so it does not have the same directory path as has been captured by the Named Variable object key). Indeed, when I then start the audio player again, the new combo box item is not added (which is appropriate); however, the key should now be deleted since the file associated with it is missing. To test this, I will rename the target file back to its original name, then restart the audio player. If all had worked well, the Named Variable object key should have been deleted, and it should not reappear in the combo box. But that is not the case--it does reappear, implying that the key was not deleted.

    So, that is my quandry. Any ideas what might be the problem?

    Thanks again for your help!

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    How and when do you save and load the Named Variable Object? I think it may be out of order in relation to the deletion...
    Working as fast as I can on Fusion 3

  8. #8
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

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

    Question Deleting key issue...

    Hey, LB!

    I've posted my MFA to this post. If you go to the second frame, you'll see this condition:

    On Fastloop "Opening Window When Preferences Exist" (this Fastloop takes place when the Named Variable object has saved an external NVO file)
    Named Variable object array "Done Loading"


    It is in this condition (event 7) that the action to iterate the array takes place.

    Events 57 and 58 outline the conditions during the Named Variable object's array iteration.


    You may be on to something, as I am finding another anomaly which I cannot fathom. If a custom audio loop is selected to be played (from the "Media Player Mode" combo box), then a Named Variable object key named "Custom Audio Loop Selected" is set to "1" (which simply indicates that this is the playback mode for the audio player). If the "Close" button is selected, then the Named Variable object is saved to an NVO file. I have confirmed with both NVO and INI formats that all the appropriate variables are being saved correctly. When the application is opened again, the Named Variable object's NVO file is loaded, and the key "Custom Audio Loop Selected" is set to "1", then a Fastloop is to run which sets up the player GUI and starts playing the custom loop audio that was last playing before the audio player was closed. This Fastloop isn't running, which indicates that a similar problem may be happening as what you're describing.

    I wonder, do I need to turn on a flag once the Named Variable object has iterated the array (then, in all pertinent events, specify that the flag is on)?

    What do you think?
    Attached files Attached files

  9. #9
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    When I close the application, it crashes. Maybe this is why?
    Working as fast as I can on Fusion 3

  10. #10
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, LB!

    Hmmm... When I use the application on my test computers, it doesn't crash when I close the application. (Silly question: I assume you're using the "X" button in the upper right to close the application?) Can you describe the environment you're using? I wonder if it's crashing on an OS which I haven't tested.

    So, when you look at the code, everything seems as it should be?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. iOS Video: "stopped" and "paused" events don't work?
    By smart_fr in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 25th August 2012, 02:03 AM
  2. BUG: "Move to Layer" action does not seem to work
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd January 2012, 10:16 PM
  3. Problem with saving/loading an NVO array file from the Named Variable object?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 12th January 2012, 02:17 PM
  4. Subapp and "Jump to a frame" action doesn't work
    By Tiny in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 2nd December 2008, 03:10 PM
  5. "Load frame" action doesn't work in exe
    By Tatsu in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 24th January 2008, 01:57 AM

Posting Permissions

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