Skip to content

Masters

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

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

Properties

master

Read only. Master name as defined in Axure.

autostart

An autostart property determines if master instances are created at startup. It is set to false by default and can be changed only in masterContext() or prepareMasterContext() methods. Find out more about it in the Startup events section.

Methods

fireEvent(eventName, [other, params])

This triggers a master's custom event that is defined in the authoring environment (Axure). Params you provide will be propagated to all AXHOOX scripts attached to this event.

        var myMaster = scriptContext.getOwner();
        myMaster.fireEvent('OnThisSpecialCase', 'foo', 'bar', true);

If you would like to access params provided you have to rely on arguments object:

        // OnThisSpecialCase event script
        console.log(eventName + ' occured. Listing params:');
        for (var i = 2; i < arguments.length; i++) {
            // counting from 2 because first param is scriptContext and second is eventName
            console.log('Param number: ' + i + ', value is: ' + arguments[i]);
        }

Extending masters

You can extend master's default behavior by specifying master prototype. Read more about it in the Startup events section.

Clone this wiki locally