How do I navigate between pages

Just started using Construct 2? Post your questions here

Post » Mon Aug 18, 2014 9:17 am

Hello,

I am trying to create an interactive book and cannot seem to get the page navigation working properly. I have two sprites (one for next and one for back) and want the pages to change when the user touches them. This is what i have so far...

I have attached the event sheet.

The Global Variable "CurrentPage" does change when the sprite is touched (checked in debug mode) but the Layout does not. I have also tried using "Layout"&CurrentPage but this behaves the same.

Any advice?

Thanks.
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 4
Reputation: 208

Post » Mon Aug 18, 2014 9:34 am

You should navigate to a layout by name, but we can't see those without the capx. What are they called? "Layout 1", "Layout 2"?

Edit: Make sure you have the space between 'Layout' and the number.

Suggestions. You don't need the check for CurrentPage in event 6 and 7, and adding System:Once while true to events 2-5 would advisable.
Last edited by codah on Mon Aug 18, 2014 9:36 am, edited 2 times in total.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Aug 18, 2014 9:36 am

Hi Codah,

Yes, they are named Layout1, Layout2...
B
4
Posts: 4
Reputation: 208

Post » Mon Aug 18, 2014 9:38 am

Aadil wrote:Hi Codah,

Yes, they are named Layout1, Layout2...


Without a space..?
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Aug 18, 2014 9:46 am

OK... I found the problem, i was missing a space. so "Layout"&CurrentPage should have been "Layout "&CurrentPage.

The reason i check for CurrentPage in events 6&7 is that even though the sprite disappears (invisible) on the last page, clicking on the empty space still increases the CurrentPage value. Not sure if it makes a difference but I prefer to be safe.

Thanks for your help.
B
4
Posts: 4
Reputation: 208

Post » Mon Aug 18, 2014 9:48 am

Lol
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Mon Aug 18, 2014 10:11 am

I have a new issue now... the pages change fine, but when going backwards (i.e. pg 5,4,3,2,1) the forward button disappears on pg 2 and both disappear on page 1... :?
You do not have the required permissions to view the files attached to this post.
B
4
Posts: 4
Reputation: 208


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests