This tag defines a media object, that can be presented within a view. A media object is an image, movie, animation, or sound clip. This tag imports the object into the application, and binds it to a string which can be used within a view. For example:
<canvas height="70">
<resource name="logo" src="../images/logo.png"/>
<view resource="logo"/>
</canvas>
The src attribute refers to the filename of any valid resource type, including an optional directory path relative to the directory of the declaration. Valid resource types for images and animations include: .SWF, .PNG, .JPG, and .GIF; valid audio types include: .MP3.
Audio resources must be MP3 files at one of the following sample rates: 11.025 khz, 22.5 khz, and 44.1 khz, and encoded at no more than 160kbps.
The dataimage example
further demonstrates the use of the resource tag.
For details on multi-frame resources, see frame.
| Name | Type (tag) | Type (js) | Default | Category |
|---|---|---|---|---|
name
|
token | initialize-only | ||
| The name of a variable that will be set to this object when the application is started. If this element is directly within a canvas or library element, the global variable and the canvas property with this name will be set to this object. If this element is within another object, that object's property with this name will be set to this object. | ||||
src
|
URL | initialize-only | ||
| The path of a file that contains the source for this object. | ||||
Copyright © 2002-2008 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.