Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 6 of 6

Thread: Web objects

  1. #1
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770

    Web objects

    Not sure if this can be done but may as well ask right .
    I want to have a web object on the left of the panel like and have links in it to html pages that will be in the folder to a web object on the right side panel .
    Can that be done were the left panel web object can open a page in the right web object ?
    If not can I have the web object on the left panel open a page with a web object that would have the html built in to the web object on that page ?
    I'll add a picture to give you some idea what i want to do .
    The left pane is a html page and the right is one too .
    Thanks for the help .
    Attached Images

  2. #2
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Taken from the help file:

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

    For example, if you have the following HTML file in a web object (let's call it index.html):

    <html>
    <body>
    <a href="#Page2">Go to Page 2</a>
    </body>
    </html>

    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.

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


    Instead of the action Page.Jump, use that variable to load a html file into your second webObject.

    Good luck

    Yossi

  3. #3
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Thank you , I will give that a try and if I need help I will be back with some code .

  4. #4
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    I can't seem to get it to work , would you or could you make a small simple with one page and how it works .
    Thank you so much .

  5. #5
    Join Date
    Feb 2005
    Location
    Mn
    Posts
    770
    Ok kind of have it working but I get this error when I click on the link and then when I click the ok button on the error popup the page loads .
    ---------------------------
    Error
    ---------------------------
    Page2 -> Web1 -> On Navigate, Line 12: Argument 1 must be of type string.
    ---------------------------
    OK
    ---------------------------

  6. #6
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    You need to put it in between quotes (")
    Yossi

Similar Threads

  1. web objects
    By SonHouse in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 03-01-2004, 11:03 AM
  2. Interacting with Embedded Web Objects
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 10-01-2003, 02:17 PM
  3. Exit application and web objects?
    By MontyJ in forum AutoPlay Media Studio 4.0
    Replies: 3
    Last Post: 06-03-2003, 01:32 PM
  4. HOW TO: Return a Web Browser Object to the Original URL after a Page Jump
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 02-03-2003, 09:18 AM
  5. Z-order problems between web browser and ams4 objects
    By Martin_SBT in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 09-26-2002, 11:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts