Source language: Translate to:

Problem 'navigating'

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Problem 'navigating'

Postby seanie » Mon Aug 07, 2017 4:33 pm

Hello all,

I'm making an application with buttons to go back. All the GotoPage actions work correctly, except when I use the GotoFirstPage command. The app does it then immediately goes to the second page. That page also has a button with the GotoFirstPage command, and that one lets me go to - and stay on - the first page. My question is why does every other button with the GotoFirstPage command (apart from the one on the second page) carry out the action (first page flashes briefly) then there is a jump immediately to the second page? I'm stumped. I've even tested with the GotoPreviousPage command (to go back to the first page from page 3, 4, etc.), and the result is the same: first page flashes briefly, then the application settles on the second page. I'm stumped :?

Thanks for reading.

S
seanie
 
Posts: 47
Joined: Tue Jul 31, 2007 9:33 am

Re: Problem 'navigating'

Postby Gaev » Mon Aug 07, 2017 5:23 pm

Seanie:

Do you have code in the ...

a) PageEnter section of your First Page ?

b) Page Change section of your Pub ?

... from your description, there might be logic that redirects to the Second Page under certain situations

If this does not give you a clue, take a look at the debugger details to see what commands are being serviced after the GoToFirstPage command.

You might also (temporarily) change GoToFirstPage in one of your Buttons to ...

GoToPage "{nameOfYourFirstPagehere}"

or

GoToPageNum "1"

... and tell us if you get same/different results.
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Problem 'navigating'

Postby seanie » Mon Aug 07, 2017 8:39 pm

Thanks for your interest Gaev.

I've just checked, and there is no code in the PageEnter section of the first page ("New Page"). There is, however, this kind of code (play audio) on "New Page 2" (the third page of the app). When I click the button on "New Page 2" to go to "New Page", it ("New Page") flashes a bit, but the app 'settles' on "New Page 1" (the second page). This second page also has a button to go to the first page, and this works perfectly... so the app is not a total loss. It's just maddening :)

I don't quite understand what Page Change refers to, but here's what I copied from the Debugger (started on first page, then clicked a button to go to the third page "New Page 2", then clicked to go back to the first page):

PushButton3 > Left Click
+ GotoPage "New Page 2"

New Page 2 > Page Enter
+ PlaySoundFile "C:\Users\Sean\Desktop\TL Class App\TL App 1\T3Info.mp3" "Wait"

PushButton32 > Left Click
+ GotoPage "New Page"
+ StopMedia "C:\Users\Sean\Desktop\TL Class App\TL App 1\T3Info.mp3"

I've tried the GotoPage option, but that didn't work either.
seanie
 
Posts: 47
Joined: Tue Jul 31, 2007 9:33 am

UPDATE Re: Problem 'navigating'

Postby seanie » Tue Aug 08, 2017 3:39 am

I came up with a rather bizarre solution:

Since the app was jumping from Page 1 to Page 2 for some unknown reason, I decided to copy Page 1 (ended up being "New Page 10", so the order of the pages was now "New Page". "New Page 10", "New Page 1", "New Page 2", etc.) and left the buttons with the original commands.

This 'solution' worked! I'm not happy about it, but my students (the users) will never know :)

Thanks again, Gaev!
seanie
 
Posts: 47
Joined: Tue Jul 31, 2007 9:33 am

Re: Problem 'navigating'

Postby Gaev » Tue Aug 08, 2017 5:29 am

Seanie:

Should have asked this before ... who developed this Pub ? ... that person should be aware of the code sections for the various navigation events (like PageEnter, PageExit, Page Change etc.) ?

I don't quite understand what Page Change refers to

In Design Mode, if you hit the F12 key on your keyboard, you will see a popup window ... at the bottom, you will see tabs for Startup, Shutdown etc. ... one of them is labelled Page Change ... click on it to see if there is any code in this event section ... you can read the Help file to understand when it is invoked/serviced.

here's what I copied from the Debugger (started on first page, then clicked a button to go to the third page "New Page 2", then clicked to go back to the first page):

PushButton3 > Left Click
+ GotoPage "New Page 2"

New Page 2 > Page Enter
+ PlaySoundFile "C:\Users\Sean\Desktop\TL Class App\TL App 1\T3Info.mp3" "Wait"

PushButton32 > Left Click
+ GotoPage "New Page"
+ StopMedia "C:\Users\Sean\Desktop\TL Class App\TL App 1\T3Info.mp3"

In the PageEnter code section for "New Page 2", it plays the mp3 file ... but it is requested to WAIT further servicing of commands until this file finishes playing.

According to the Debuuger, the left click of Button32 was serviced next ... which is the one that causes re-navigation to "New Page" (and stops playing the mp3 file).

Can you tell us where Button32 is located ... if it is located on "New Page 2" (and is the one you click to take you to "New Page 1"), ... this could be happening because the mp3 file has not finished playing when you click on this Button ... and when it does, NeoBook tries to go back to this page to try and service any more commands in the PageEnter section of "New Page 2"

So, post the code associated with the ...

- left click of Button32
- PageEnter section of "New Page 2"
. code (if any) in the Page Change section of the Pub
User avatar
Gaev
 
Posts: 3728
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Problem 'navigating'

Postby seanie » Tue Aug 08, 2017 1:48 pm

Should have asked this before ... who developed this Pub ? ... that person should be aware of the code sections for the various navigation events (like PageEnter, PageExit, Page Change etc.) ?


It may surprise you because of my low skills, but I made the app :)

In Design Mode, if you hit the F12 key on your keyboard, you will see a popup window ... at the bottom, you will see tabs for Startup, Shutdown etc. ... one of them is labelled Page Change ... click on it to see if there is any code in this event section ... you can read the Help file to understand when it is invoked/serviced.


Thanks for that. I've used F12, and there aren't any PageChange commands.


In the PageEnter code section for "New Page 2", it plays the mp3 file ... but it is requested to WAIT further servicing of commands until this file finishes playing.

According to the Debuuger, the left click of Button32 was serviced next ... which is the one that causes re-navigation to "New Page" (and stops playing the mp3 file).

Can you tell us where Button32 is located ... if it is located on "New Page 2" (and is the one you click to take you to "New Page 1"), ... this could be happening because the mp3 file has not finished playing when you click on this Button ... and when it does, NeoBook tries to go back to this page to try and service any more commands in the PageEnter section of "New Page 2"


Yes, Button32 is located on "New Page 2".

The pubs pages (before my 'fix') are as follows:

"New Page" (the 'home' page... fist page users see with buttons to navigate to various sections of the pub), "New Page 1", "New Page 2" and so on, up to "New Page 9".

There is a button on "New Page" to get to "New Page 1" (and vice versa), but no buttons to navegate between "New Page 1" and "New Page 2" (the idea is that users would return to 'home' before going on to the next section, which starts at "New Page 2"... however, when I press the button on "New Page 2" to return to "New Page", it instead ends up at "New Page 1".

So, post the code associated with the ...

- left click of Button32
- PageEnter section of "New Page 2"
. code (if any) in the Page Change section of the Pub


left click of Button32:

GotoPage "New Page"
StopMedia "C:\Users\Sean\Desktop\TL Class App\TL App 1\T3Info.mp3"

PageEnter code:

PlaySoundFile "C:\Users\Sean\Desktop\TL Class App\TL App 1\T3Info.mp3" "Wait"
If "[StopExam]" "<>" "True"
GotoNextPage
EndIf

Hmmm... now that I've posted this, I imagine the pub is executing the GotoNextPage command even though I click the button to leave the page (and go back to the start of the publication) before the mp3 finishes playing. If this is the case, my apologies for being so dumb! I guess I figured the action (GotoNextPage) would only be carried out if the mp3 finished playing on its own. But I suppose the programme doesn't know the difference between stopping on its own and being interrupted :)

I guess I should explain the idea behind the pub. I wanted a sort of 'dual-purpose' app that could be used in class or could be used at home. The buttons were for in class, to allow students to stop/go back to ask me questions. And the auto'start of the audio was to simulate test conditions (where students have no control over exam events) so students could practise at home.

Anyway, THANK YOU for taking the time to help! I really appreciate it.
seanie
 
Posts: 47
Joined: Tue Jul 31, 2007 9:33 am


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 0 guests