Html5 and GET problems

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi,
    I have been trying to convert some of my .swf projects to html5 and am having several problems when I try to build in HTML5 but for now I'm just going to focus on one. This allows for scores to be submitted to a teacher and uses the GET object. It does have some unnecessary extra code but it works well in Flash. I am not understanding what the problem is in the attached mfa.
    Here is how it works in Flash:
    Please login to see this link. Use the e-mail biomanbio@gmail.com to test.
    You can see the same .mfa built as html5 here:
    Please login to see this link.
    Why does it not work in html5? Thanks,
    Brett

  • The GET object only works when accessing a file on a real web server, and only IF the html page where the application is located lays on the SAME server as the file.
    This is a protection against malicious intend.
    Just upload you built HTML5 project and your file on a server and it should work.

    Francois
    PM: Please login to see this link.

  • Hi Francois,
    I did upload to a real server to test. The second link is what the html5 app does on my server. The second frame is where the problem is. Please let me know what you are think. Thanks,
    Brett

  • OK, can you rebuild your example in HTML5 Development and reload it to your server?
    It is right now in Final project mode, and I cannot debug it.
    Warning : I'll be on holiday starting Friday till the end of the month.

    Francois
    PM: Please login to see this link.

  • OK I think I found out why it does not work.

    - The URL of your application is "Please login to see this link...."
    - In the second frame, you have copied the HiScore example, and you use the URL Edit text to put the URL. You actually put "Please login to see this link...."

    Notice that on one side, you have : "Please login to see this link." and on the other side you have "Please login to see this link."
    I have just read this it does not work, as the browser think the domains are different.
    You have to change the URL in the Edit text to "Please login to see this link...." and I think it should work.
    Of course, if you do the modifications, you have to upload them again to your server and test the online version.

    Also, I have noticed that the first frame of your application send a GET messages with no URL. There is definitively something to lok at there.

    Please tell me if it works. If it does not, build in Development mode and re-upload to your server.
    Sorry for the delay.

    PS : readings about Access-Control on Internet Please login to see this link.

    Francois
    PM: Please login to see this link.

  • Hi Francois,
    I tried this but I'm still seeing weird bugs. I also removed the events that check server status. Here is what I see now on the html5 version. The first frame works fine, but on the second frame, after inputting first name, last name and period, I click on the button that says "Click here after correctly entering your name!" and it makes a bunch of things on the frame disappear. I've looked through the code and there is no reason for this to happen that I can see. Clicking on this button just sets the name global values and strings and makes button disappear in the code. I don't get what is going on here. It works in swf and exe versions. Thanks,
    Brett

  • brett,

    Here is a working sample that you can download and use if you can host .aspx files. It uses an Access DB that you can upload as well. This should end any CORS issues for cross domain requests as well.

    Please login to see this link.

    Good Luck getting this working...

    Please login to see this link.

  • Thanks Kimera but I'm using a mySQL database and PHP with my Flash games and would like to use the same db with my Html5 versions of these games. Do you have any idea why html5 isn't working the same as flash in this regard? Thanks,
    Brett

  • Hey Brett,

    I don't know what issues your having in flash but I made a flash version, I just saved the old version as a flash app, and it seems to work just fine. Maybe it can help you with what ever issues your having.

    Please login to see this link.

    I don't know PHP very well and MySQL is just another version of SQL, I have written against many versions in my life so I don't see that being your issue. The main thing that may be causing problems for anyone in this type of app is if the page your are requesting is not in the same domain your requesting from, then you will have issues and my need to set up CORS. For example if your load a page by going to Please login to see this link. and your are requesting a page from Please login to see this link. you will not be able to get the information you want. This solution provides a developer with the ability to put the database and pages they are requesting in the same location as the pages they are requesting from. This eliminates the need for CORS and an Access DB can get as large as about 2 GB so it would be a while before you max it out.

    Additionally this solutions makes your project very portable and will allow you to move it from one server to another without much of an issue. I don't know PHP or I would do a version for you in PHP but if you already know how to make a DB connection in PHP, and are already writing SQL statements, then you should be able to convert what I have done in this to a PHP version if you wanted.

    Hope that helps!

    Please login to see this link.

  • Hi,
    I haven't had much time to look at the forum for a while, but thank you for your replies. I think I can confirm that the issue is something related to CORS as mentioned by Kimera. The specific error I get in Chrome when I look at the developer console is "XMLHttpRequest cannot load Please login to see this link.. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'Please login to see this link.' is therefore not allowed access."

    This only occurs if I access the file with the following url: Please login to see this link. (this does not work and generates the error)
    If I access the file with the same URL minus the "www" then the program works well in both Chrome and Firefox. See the following URL for the difference: Please login to see this link. (this does work).

    I do not, however, understand why the browser doesn't recognize that these are the same domain or how exactly to fix the problem (Both URLs are actually the exact same resource). How do I add the 'Access-Control-Allow-Origin' header, what is its format and where does it go? All of the resources I am accessing are on my shared server with HostGator under the same domain.

    On another note, Internet Explorer really messes up the application. It doesn't look right at all and generates an error message whether the URL has "www" or not. Click either link above in Internet Explorer to see what I mean. In Internet Explorer, the developer options has several error messages, including warnings of deprecated code. I imagine this code would need to be updated for Fusion 2.5 itself.

    Thanks for any insight in to how to solve this problem.
    Brett

  • Hi,
    Adding the following code snippet to my php fixes the problem in chrome and firefox:
    <?php
    header("Access-Control-Allow-Origin: *");

    Note: Omit the <?php if you already have this in your php at the top.

    I still see a messed up app in IE. Not sure what this is about.

  • Fixed for IE now as well. There was an extra unnecessary GET request that was causing problems in IE but this is fixed as well. Does anyone know if using the "Access-Control-Allow-Origin: *" header causes security vulnerabilities. There is a way to restrict it to another particular domain only. Would this be better or is the wildcard header fine? thanks,
    Brett

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!