Scene Transitions

In this Lesson

You will learn what a scene transition is and how to use it.

Concepts

Scenes are the navigable unit in Soiree. So, what is a navigable unit? A navigable unit is

  • A place you can ‘go to’ in the Solution.
    You can make requests to ‘go to’ a scene. You cannot make a request to ‘go to’ a layer.
  • An item you can place on a menu.
    Menus are designed to take you places within the solution. So, menus may contain scenes because they are a navigable unit but menus may not contain layers because they are not a navigable unit. [ you will create menus in a later lesson ]
  • Navigable units are secured.
    You cannot get to a scene unless you are granted access to it. You can configure the security system to grant access to everyone or to restrict a scene to certain set of people. [ you will play with the security system in a later lesson ]

There are three ways to navigate to a scene

  1. Declarations in the Solution
    For example, the Solution defines the Initial Scene that should be displayed when the solution starts. [ there are other ‘scene starting’ declarations in the Solution and those are beyond the scope of this lesson ]
  2. Scene Request
    This is the ability of an Agent (program) to request a scene to be opened. [ this is covered in a future lesson ]
  3. Scene Transitions
    This is the ability of one Scene to request a transfer, or transition, to another scene.

This lesson focuses on scene transitions.

A scene transition is a transfer of control from one scene to another. To be more precise, it is a declaration within a scene to transition to another scene often in response to an event such as a person clicking on a button.

When Scene-A requests a transition to Scene-B it causes Scene-A to be closed and Scene-B to be opened.

Security can shut you down

Scenes are secured, by default. [unlike layers which, by default, are freely accessed once the scene is opened.].
If a person does have the security clearance to access a scene the request will be denied.

Create a scene transition

You will need to have two scenes to perform a scene transition – so let’s begin this lesson by creating your second scene.

In the new scene you will be using the party fish image from the Creating a Scene lesson. You probably still have that image available on your computer’s file system from the download you performed in that lesson, however, instead of taking the easy path and using that image we want to show you how to obtain an image from another scene.

You will now get the image you need from the first scene you created.

  1. Open the PartyDefinition scene.
  2. Expand the scene’s image library

    scene
  3. Click the party fish image to select it

    scene
  4. Click the Export selected images button, select your desktop folder, and press Save

    scene
  5. The image will be exported to your desktop with a random name as shown here.

    scene
  6. Close the PartyDefinition scene.

You will now create a second scene using that exported image.

  1. Select the com.example.party.scene package by left clicking on it.

    scene
  2. Create a new desktop scene by pressing CTRL+N (Windows) or Command+N (OS X) to open the Wizard selection window. Expand the Soiree section and select Scene.

    scene
  3. Enter a scene name of PartySplash and other information as shown here

    scene
  4. Drag the exported fish image file into the scene’s image catalog
    Tip
    You do NOT need to open the image catalog before dragging. As you are dragging the image you can pause momentarily over the Images tab and the catalog will open. [ it’s like a garage door opener with eyes ]
    scene
  5. Drag the party fish from the image catalog onto the design canvas.
    Ensure the Image Button option is selected before you drop the image.

    scene
    Element Options
    As you are dragging an image onto the canvas you may select the type of Element to create when the image is dropped by pressing the ALT key while you are dragging.
  6. Click on the Images tab to close the image catalog.

    scene
  7. Add a label as shown here

    scene
  8. Right click the image button and configure the scene transition as shown here

    scene
  9. Save close the scene.

Modify the Solution to start with the splash screen

  1. Open the PartyPool solution.

    scene
  2. Change the Initial Scene to be the splash scene.

    scene
  3. Save and close the solution.

Test the Scene Transition

  1. Start the Derby database if it is not already running.
  2. Start the server

    scene
  3. Start the solution

    scene
  4. Test the scene transition by clicking on the splash scene’s image button

    scene
  5. The scene transition test should fail

    scene

If your test failed you have succeeded! Congratulations on such a superb failure.

Your final grade is an A+
Don’t you wish all your professors would give you such a good mark for failing their tests?

You will resolve this security issue in the next lesson.

That’s it for this lesson.