User Tag List

Results 1 to 8 of 8

Thread: HTML5 opening external files in list box

  1. #1
    Clicker Fusion 2.5 Developer
    JohnZ's Avatar
    Join Date
    Jul 2006
    Posts
    140
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Question HTML5 opening external files in list box

    Hi there

    I've only just purchased the HTML5 exporter so my knowledge is limited...


    Is it possible to load external files in the ListBox or into an ini object from an HTML5 app? If so, where should I store my external files? What would the path look like?

    Things work fine when testing as a normal app but fail when I 'build and run'.

    Will there be (is there) a separate thread for the HTML5 exporter? I notice there is one for all the others.

    Cheers
    J

  2. #2
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall Creator Pro

    Join Date
    Dec 2010
    Location
    United Kingdom
    Posts
    960
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    HTML5 cannot read/write files directly on the user's machine, so it'll need to be on the server side. External files will need to be same folder as the HTML file.

    So a directory with:
    • resources/
    • scr/
    • MyApp.html
    • listobject.txt

    You'd use the expression "listobject.txt" to load the external file listobject.txt into a List Box, as long as the file is in the server's root path (or beside the MFA file)

    The best way is probably to test your apps fully with the HTML5 module rather solely relying on Fusion's built-in run function (EXE), as the runtime's are slightly different.

    The HTML5 exporter outlines a few differences that you should be aware of. You can view the entire PDF on their website here.

    Quote Originally Posted by HTML5 Runtime Differences
    Files. Javascript cannot write or read any file on the machine of the user. It can save and read data
    in a specific browser-dependant folder, and read data directly from the web server where the
    application is located.
    The Edit, List, Combo and Ini objects first try to load the data from a previous data section saved
    by the application. If they cannot find it, they will try to load it from the binary file section of the
    application. If the file cannot be loaded from there, they will try to load the file from the web
    server (the file should be located beside the html file).
    Unlike the Windows runtime, the HTML5 runtime only takes the name and extension of the file
    into account when retrieving the file : the path and drive are ignored.
    Example : an INI object can have a full pathname (linking beside the Windows "MFA" file), this
    pathname will be ignored by the HTML5 runtime, and the name and extension of the file will only
    be used to save and load the INI data.
    For the separate threads question: I would of thought so, a forum makeover I believe should be here soon.

  3. #3
    Clicker Fusion 2.5 Developer
    JohnZ's Avatar
    Join Date
    Jul 2006
    Posts
    140
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply and your help.

    So using the path in the way you have suggested my text file should load when I run it under 'build & run'. I can't get this to work, whereas it does work run as a normal app. Do I need to load the project onto my webs space to test it?

    J

    UPDATE: I've just tried uploading my project to my webspace with this structure and it still doesn't work. All my project contains is the listBox object and 'Load List File 'text.txt'' as the start of the frame.

  4. #4
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleInstall Creator Pro

    Join Date
    Dec 2010
    Location
    United Kingdom
    Posts
    960
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're welcome. I personally haven't been able to get the "Build & Run" function to work at all (white screen), but if you have a web server handy (I have a one running on localhost) then it should work.

  5. #5
    Clicker Fusion 2.5 Developer
    JohnZ's Avatar
    Join Date
    Jul 2006
    Posts
    140
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi there

    I still can get this to work - has anybody had an experince of loading external files into a list object - running the app on a web server?

    Cheers
    J

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Francois's Avatar
    Join Date
    Jul 2006
    Location
    Montpellier, France
    Posts
    6,920
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    I had to remove the possibility of loading directly on the server : there is no way of catching an error is the URL is incorrect, meaning that the application just crashes, with no external sign of why. I could a way to test for the presence of a file on a server in Javascript.
    You need to insert the file in the Binary Datas of your application : click on the button on the right of the event-list editor button, go to binary files, and insert the file here. The objects will read the file directly from the application.

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Aug 2006
    Posts
    540
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hello ,
    I'm bumping this old thread because I can't load a .txt file in a combo box ; it works when I run the app , but not if I " build and run" ( development)
    I have added it to the binary data ;
    on my web server ( final project ) it's standing next to index.html
    is it because html 5 only handles .ini files, not txt files ??
    Thanks for your help,
    eric
    [edit : I realize this was in the mmf 2 forum , but I'm using fusion 2.5 284.10 unicode

  8. #8
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)
    ratty's Avatar
    Join Date
    Apr 2012
    Posts
    1,128
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Did you find a solution?

Similar Threads

  1. Opening old .gam files?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 12th August 2011, 11:52 AM
  2. Opening a local external PDF from within a MMF-SWF
    By Boba Fonts in forum SWF/Flash Export Module Version 2.0
    Replies: 9
    Last Post: 2nd January 2011, 11:30 PM
  3. Opening Files...
    By dingdong in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 19th February 2007, 07:30 PM

Tags for this Thread

Posting Permissions

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