Skip to content

API Reference

Rafał Grabie edited this page Jul 27, 2013 · 9 revisions

Axure Page | Masters | Dynamic panels | Button shapes and rich text panels | Image map regions

The scriptContext object

is always available within your event scripts

Common properties

type

Axure object's type as string

label

Object's label used in Axure

path

Object's location in Axure's document structure

data

This is where you can store any property without fear to affect something important

page

This always points to a scriptContext object associated with a page

Common methods

get()

Get a reference to any of objects from the sctructure.
        var foo = scriptContext.get('bar');
        var bar = foo.get('/foo/bar/baz');
        var page = bar.get('/');

get() accepts relative: something/relative and absolute: /an/absolute/path subpaths

getParent()

Get a reference to a direct ancestor.
        var foo = scriptContext.getParent();
        console.log(foo.get(scriptContext.label) === scriptContext) // true

getOwner()

Get object that logically owns a scriptContext

If scriptContext is a part of a master then it will get a reference to a closest master.
Otherwise it will get the page object.

        console.log(scriptContext.path) // /master-instance-1/dynamic-panel-1/bar
        var foo = scriptContext.getOwner();
        console.log(foo.path) // /master-instance-1
        console.log(foo.getOwner() === scriptContext.page) // true

Implementations


Next reading: