Aw url click

From ActiveWiki
Revision as of 10:53, 26 October 2008 by Macavity (talk | contribs) (Added in, cleanup)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Minimum requirements
Added in version 3.5
SDKbuild 37
Worldbuild 63
Browserbuild 530


int aw_url_click (const char *url)

Description

Simulates clicking on a special URL in the web view.

Callback

None (returns immediately)

Notes

The Active Worlds Browser uses this method to announce URLs starting with the "aworld:?" prefix to nearby caretaker bots and global bots.

This method triggers the event AW_EVENT_URL_CLICK in all neighbor SDK applications that have subscribed to the event. It is intended for use by the browser to indicate when a user clicks on a special URL in its web view, however it is also available for use by SDK applications which may wish to simulate URL click actions for the purposes of testing, etc.

The browser only reports data after URLs prefixed with "aworld:?". Example: "aworld:?test" will trigger an event with AW_URL_NAME set to "test". Also, "aworld:?close" is trapped by the browser and is used to close the viewport web view without prompting.

Arguments

url
URL that was clicked.

Argument attributes

None

Return values

RC_SUCCESS
RC_NOT_INITIALIZED
RC_NO_INSTANCE
RC_NO_CONNECTION
The connection to the world is down.

Returned attributes

None

Usage

Simulate URL click.

void handle_url_click (void)
{
  printf ("%s (sess#=%d) send url: %s\n"
    aw_string (AW_AVATAR_NAME),
    aw_int (AW_AVATAR_SESSION),
    aw_string (AW_URL_NAME));
}

aw_event_set (AW_EVENT_URL_CLICK, handle_url_click);
aw_url_click ("aworld:?buyItem=RedPants");

See also