HTML Xtra white paper

The HTML Xtra FAQs.

 

 

 

How do I create a html cast member ?

To create a html cast member, simply choose "MediaConnect Xtras" -> "HTML field" from the "Insert" menu. A new HTML cast member will be generated in the cast window.

top

How can I load html ?

In order to load html into the html cast member, use the FileIO Xtra. Here is a simple script for that purpose:

on htmlload mem, file
cursor 4
set myfile = new( xtra "FileIO" )
openfile( myfile, file, 1 )

if (status(myfile)) then
alert "Error on opening file:" & return & file
set source = empty
else
set source = readfile( myfile )
if (status(myfile)) then
alert "Error on opening file:" & return & file
set source = empty
end if
closefile( myfile ) -- close the file
end if
set myfile = 0 -- dispose of the FileIO instance
set the html of member mem = source
set source = 0 -- Free the space occupied by html source
cursor -1
end htmlload

Given, your html member is named "HTML", and the file you want to load is "myhtm.html" you could use:
htmlload ( "HTML", the moviepath & "myhtm.html" )

top

 

How do I use the callback for links?

Paste the following script as a cast member script, for your html cast member

on link linkstr
put str
end

When a user clicks on a link, you will see the content if the link tag in the message window.

top

 

What is the use of the Meta tag?

We have designed that functionality basically for a tracking for information about the document itself.
The index engine will create entries for the meta tag that contain information about the document and its position inside a given structure. Thus you can display a history for a tree of documents which is clickable.

This is the "built-in" functionality used by the indexer. You could use the META tag for a wide variety of other operations, too. Since the content of all META tags gets parsed automatically, you can check for it and do with it whatever you like.

If you don´t use the indexer and have a "Text1.htm" that belongs to a "Section1.htm" you could write a tag

<META NAME="Section1.htm" CONTENT="myfolder1/Section1.htm"><META NAME="Text1.htm" CONTENT="myfolder1/Section1/Text1.htm">

You can check for the meta content with "the meta of member". You get a list of lists. The form is:

[ [ string META 1 name, string META 1 content ], [string META 2 name, string META 2 content ], .... ]

This way you can display a structure for the open document in a director field, but you can also use it for calling a lingo routine.

See the following example:

<META NAME="This is Text 1" CONTENT="Text1.htm"><META NAME="A lingo routine" CONTENT="beep">

given, the name of your HTML cast member is "HTML" and the last meta tag in your document is the name of a lingo routine:

do getat(getat(the meta of member "HTML", count(the meta of member "HTML")), 2)

would call it.

top

 

How does the Xtra render HTML?

On opening of a new document, it parses the whole text. Then it always renders only the portion that is currently visible on stage.

top

 

Will you add addidtional tags and new functions?

Yes, we will. Look for updates in our Xtras download area.

top

 

Does the Xtra support images?

No, sorry, there is no image support at the moment. In a balancing between functionality and speed, we have decided to vote against images. We would have to control the import ourselves and write quite a lot of code for it. Since images could be JPEGs and the screen set to 256 colors, we would have to dither them into the html field. If they were GIFs, the could have the wrong palette and we would need to remap them. We have already thought of doing it, but it would really take a lot of time. If images are essential for you, please contact us. If there is a need, we will perhaps add them with the next version.

top

 

Don´t you have a Demo.dir with ready made functions ?

You can download a combined HTML & Index Xtra Demo movie in our Xtras download area.

top