i really need any ajax progress and any ajax error !

Get help using Construct 2

Post » Thu Mar 03, 2016 3:53 pm

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 !?
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Thu Mar 03, 2016 4:27 pm

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.
Zelda Gamekit (my project)



Example capxs:

Zelda-Style Inventory

Zelda Health

3-saveslot system

[url=https://www.dropbox.com/s/d4396pwak0oh7q6/ZeldaDialogueSystem.capx?dl=0]Zelda-like Dialogue[
B
51
S
24
G
30
Posts: 534
Reputation: 19,620

Post » Thu Mar 03, 2016 5:08 pm

LaDestitute wrote: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
Code: Select all
On "Req1" completed OR On "Req2" completed OR On "Req3" completed -> action
but that's very time consuming if you have lots of requests/tags.
B
32
S
7
G
4
Posts: 398
Reputation: 4,591

Post » Thu Mar 03, 2016 7:32 pm

grigrizljac wrote:
LaDestitute wrote: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
Code: Select all
On "Req1" completed OR On "Req2" completed OR On "Req3" completed -> action
but that's very time consuming if you have lots of requests/tags.

yes exactly
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Thu Mar 03, 2016 8:49 pm

You can make a loop to check "Req"&loopindex
Image ImageImage
B
169
S
50
G
174
Posts: 8,322
Reputation: 110,788

Post » Fri Mar 04, 2016 8:49 pm

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
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Sat Mar 05, 2016 12:01 pm

Magistross wrote: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
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Sat Mar 05, 2016 3:48 pm

Magistross wrote: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 !
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Sat Mar 05, 2016 5:35 pm

Do you mean a trigger that encompass all the other three ?
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Sat Mar 05, 2016 6:47 pm

Magistross wrote: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.
B
16
S
6
Posts: 243
Reputation: 1,755

Next

Return to How do I....?

Who is online

Users browsing this forum: beohs, brunopalermo and 15 guests