i really need any ajax progress and any ajax error !

0 favourites
  • 12 posts
From the Asset Store
Progress\Loading Bar. Now Load you game like a Professional.
  • hi i really need any ajax progress and any ajax error ?

    ajax is one of the most important things in html5 why constrcut 2 have so little expressions and events for that !?

  • Read some tutorials, look at the manual, and/or do an actual proper search.

    Your question isn't a clear one either, and is very broad.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Read some tutorials, look at the manual, and/or do an actual proper search.

    Your question isn't a clear one either, and is very broad.

    I guess mahdi71 wants to have a condition On any error, On any progress, On any completed – without tags.

    Let's say you have 3 ajax requests, each one with a different tag (let's tag them "Req1", "Req2", "Req3").

    Now, the user would like to execute some actions, no matter on which request completed/error/progress. Right now, it seems like the only option is to have

    On "Req1" completed OR On "Req2" completed OR On "Req3" completed -> action[/code:g6dumu0l] but that's very time consuming if you have lots of requests/tags.
  • > Read some tutorials, look at the manual, and/or do an actual proper search.

    > Your question isn't a clear one either, and is very broad.

    >

    I guess mahdi71 wants to have a condition On any error, On any progress, On any completed – without tags.

    Let's say you have 3 ajax requests, each one with a different tag (let's tag them "Req1", "Req2", "Req3").

    Now, the user would like to execute some actions, no matter on which request completed/error/progress. Right now, it seems like the only option is to have

    On "Req1" completed OR On "Req2" completed OR On "Req3" completed -> action[/code:3t5kzzs6] [b]but that's very time consuming if you have lots of requests/tags[/b].
    

    yes exactly

  • You can make a loop to check "Req"&loopindex

  • I know it's generally viewed as a "bad idea" but you could use a modified version of the plugin. Here, I've added 3 triggers (AnyCompleted, AnyError, AnyProgress) and an expression (LastTag) to the official AJAX plugin.

    https://dl.dropboxusercontent.com/u/7004246/ajaxEx.zip

  • I know it's generally viewed as a "bad idea" but you could use a modified version of the plugin. Here, I've added 3 triggers (AnyCompleted, AnyError, AnyProgress) and an expression (LastTag) to the official AJAX plugin.

    https://dl.dropboxusercontent.com/u/7004246/ajaxEx.zip

    thanks

    scirra must add this to ajax plugin

    i will test this, and use it if it was ok

  • I know it's generally viewed as a "bad idea" but you could use a modified version of the plugin. Here, I've added 3 triggers (AnyCompleted, AnyError, AnyProgress) and an expression (LastTag) to the official AJAX plugin.

    https://dl.dropboxusercontent.com/u/7004246/ajaxEx.zip

    can you add an on any send trigger ?! i need it for check if there is a long time since ajax is sended for showing no wifi icon on screen !

  • Do you mean a trigger that encompass all the other three ?

  • Do you mean a trigger that encompass all the other three ?

    no a trigger when i use ajax send ! when we use post to url action

    what i want to do is when i send an ajax request : i want to check if there is a long time like 5 or 10 second and ajax request still in progress or waiting (because of problem on server or net disconnects and ...) then i want to show a no wifi icon on my game

    i want to use it like this :

    on any send > push to array: tag and nowtime

    on any complete > pop from array: tag and nowtime

    every tick > if there is a tag with notime more than 5 second ago then show no wifi icon and prevent user from click things.

  • Well, in that case, it's easy to do it already. Sending a request is an action, simply wrap it with a call to a function.

    "your condition to send a request" > Call Function: "SendRequest" with param "tag"

    On "SendRequest" > push to array: Param0 and nowtime, ajax: send request

  • Well, in that case, it's easy to do it already. Sending a request is an action, simply wrap it with a call to a function.

    "your condition to send a request" > Call Function: "SendRequest" with param "tag"

    On "SendRequest" > push to array: Param0 and nowtime, ajax: send request

    yes i already use an function like sendajax

    but that way is cleaer

    anyway thanks

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)