method importLibrary

library importLibrary(string url);

Argumente

Zurückgegebener Wert

This method imports the given library url into this scene. The methods returns the Library object, or null if failure.
function onSample()
{
    var lib = scene.importLibrary("../content/myGadgets.box")
    if (lib)
    {
        // myButton is a gadget in ../content/myGadgets.box
        var myButton = scene.createBox("myButton");
        if (myButton)
        {
            myButton.setAttribute("id", "testButton");
            myButton.setAttribute("label", "Added Button");
            var rootBox = scene.rootBox;
            if (rootBox)
            {
                rootBox.addChild(myButton);
            }
        }
    }
}