Forum Discussion
TheEndless
9 years agoChannel Surfer
As far as I'm aware, you still have to have an XML file that defines the component, otherwise SceneGraph won't be able to find the component you're trying to create. I don't think there's any way to register a component with SceneGraph via code.
To minimize the XML as much as possible, you could do something like this:
Then put all of your code in myGroup.brs, which will include your component specific init() and onKeyEvent() functions. Note that those are not methods on the component itself, but rather intrinsic event handler functions.
To minimize the XML as much as possible, you could do something like this:
<?xml version="1.0" encoding="utf-8" ?>
<component name="myComponent" extends="Group">
<script type="text/brightscript" uri="pkg:/components/myGroup.brs" />
</component>
Then put all of your code in myGroup.brs, which will include your component specific init() and onKeyEvent() functions. Note that those are not methods on the component itself, but rather intrinsic event handler functions.
Related Content
- 10 months ago
- 2 years ago
- 11 months ago