User Tag List

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

Thread: Directory selector problem (file object)

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Directory selector problem (file object)

    With the file object's save/load file selectors, I can know if the user clicked OK or Cancel by checking if the returned path name is empty or not.

    With the directory selector, if you select a directory and then press Cancel, the path to this directory is still retrieved. How can I know if the user pressed Cancel or not?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    --Button Pressed
    +Set Global Value A to 1
    +Open Directory Selector

    --FileSelReturn = ""
    --Global Value = 1
    --Only one action when event loops

    The user chose cancel

    --FileSelReturn <> ""
    --Global Value = 1
    --Only one action when event loops

    The user chose a directory

    Stephen1980
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    Quote Originally Posted by Nifflas
    With the directory selector, if you select a directory and then press Cancel, the path to this directory is still retrieved. How can I know if the user pressed Cancel or not?
    Working as fast as I can on Fusion 3

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Jan 2007
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    I just tried this. It works fine for me. I selected a directory and pressed cancel. FileSelReturn$( "File" ) was empty.

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    Are you sure about that?
    http://www.LB-Stuff.com/MMF2/FileDirectory.zip
    Press D then hit cancel.
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Jan 2007
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    Aha! It doesn't return the directory you selected. It returns the default pathname you entered!

    Edit: I figured out a workaround. You can take advantage of the fact that FileSelReturn$( "File" ) never ends with a slash "\". So add a slash to your default pathname, the file object will accept this, but will not return the ending slash if you press cancel.

    An example: Use as default pathname "D:\My Documents\"
    If the user selects the My Documents folder, it will return "D:\My Documents"
    If the user presses cancel "D:\My Documents\"
    So all you need to do is check if left$(FileSelReturn$( "File" ),1)!="\"

  7. #7
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    Yep! Hernan that's it! Awesome, looks like Nifflas will not have to use the Common Dialogues Obejct after all!

    Thanks for finding the solution, Hernan!
    Working as fast as I can on Fusion 3

  8. #8
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,843
    Mentioned
    261 Post(s)
    Tagged
    3 Thread(s)

    Re: Directory selector problem (file object)

    Hmm... sounds like a bug, don't use workarounds like that, that might not work on other versions of Windows or future versions of MMF2. I'm going to fix it in the release version of the build 249.

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Jan 2007
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    Well that's even better

  10. #10
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Directory selector problem (file object)

    Also, in your workaround, shouldn't you be testing for right$(FileSelReturn$("File"),1)!="\"?
    Else you are looking at the start

Page 1 of 2 1 2 LastLast

Similar Threads

  1. File Selector Style - Allow Directory Change
    By Sarah in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 6th July 2008, 04:09 PM
  2. File object - file selector saving issues
    By Gary_Molton in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th November 2006, 09:25 PM
  3. File selector styles? (file object)
    By LazyCoder in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 28th October 2006, 10:29 PM
  4. File Object Selector?
    By Rushino in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th October 2006, 05:33 AM
  5. File Object Selector Bug?
    By JSJ in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 24th July 2006, 03:49 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
  •