Announcement

Collapse
No announcement yet.

Interacting with Embedded Web Objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interacting with Embedded Web Objects

    AutoPlay Media Studio 5.0 Knowledge Base

    Interacting with Embedded Web Objects

    Document ID: IR10055
    The information in this article applies to:
    • AutoPlay Media Studio 5.0 Standard Edition
    • AutoPlay Media Studio 5.0 Professional Edition

    SUMMARY

    This article describes how to interact with embedded web objects.

    DISCUSSION

    In AutoPlay Media Studio 5.0, it is possible to navigate around your project using an embedded html file.

    As an example, create an HTML file (index.html) that contains one link (href="#Page2").

    Create a web object on the application page that loads index.html. Name it "Web1".

    Insert the following script in the page's On Preload event:

    Web.LoadURL("Web1", "AutoPlay\\Docs\\index.html");

    The above line resets the web object named Web1 to AutoPlay\Docs\index.html. This is necessary because the URL in a web object will persist across pages, and the On Navigate event is called when the web object appears on the page after a page load; if we don't reset the URL in this web object whenever the page loads, it will still have the #Page2 URL in it, and our script in the On Navigate event (see below) will make the application jump right back to page 2.

    Insert the following script in the web object's On Navigate event:
    -- search from right to left for a number sign (#)  

    nPos = String.ReverseFind(e_URL, "#", true);



    -- did we find a # ?

    if nPos then

    -- get everything to the right of the #

    strPage = String.Mid(e_URL, nPos + 1, -1);

    --[[ jump to the page name that we extracted from

    the URL. If there is no page by that name,

    the Page.Jump won't do anything. ]]

    Page.Jump(strPage);

    end
    Clicking on a link in this web object will trigger the On Navigate event and put the href string (the link target) into the event variable named e_URL. The String.ReverseFind action looks for the # symbol and, if found, a String.Mid action grabs everything to the right of the # symbol in the string. The resulting string is stored in a variable and then used as the target of a Page.Jump action.

    When the user clicks on the link 'Go to Page 2' in the example HTML file, the application will jump to "Page2".

    KEYWORDS: AutoPlay Media Studio 5.0, Navigate, Web, HTML, Control, Jump


    Last reviewed: October 1, 2003
    Copyright © 2003 Indigo Rose Corporation. All rights reserved.
Working...
X