Skip to content

File

Defined in: system/file.ts:21

Class for adding files (such as images and media) from your file system to the stage.

var XJS = require('xjs');
var File = XJS.File;
var filePromise = new File('C:\\Users\\Public\\Music\\song.mp3').addToScene();
  • Addable

new File(file): File

Defined in: system/file.ts:29

param: (file: string)

Creates a File object pertaining to a file’s full path.

string

File

addToScene(value?): Promise<any>

Defined in: system/file.ts:47

param: (value?: number | Scene)

return: Promise<any>

Adds this file to the current scene by default. Accepts an optional parameter value, which, when supplied, points to the scene where item will be added instead. If ready config {listenToItemAdd: true} it returns item id, else returns boolean.

Note: There is yet no way to detect error responses for this action.

number | Scene

Promise<any>

Addable.addToScene