Page 1 of 1

Assign an URL Param read from memory to an embeded object

PostPosted: Sat Dec 18, 2010 11:10 pm
by Skywalker
Seasons Greetings to all.

I am trying to use an embedded windows media player that is executed from an external txt file which in turn is displayed inside a neobook standalone publication via a WebBrowser Element.

The following is what I have so far…

1 Button: Action Command for Left Click;
Filewrite "C:\Users\Frank\Desktop\htmlTest.txt" "13" "<PARAM NAME=[#34]URL[#34]VALUE=[#34][myurl][#34]"
FileRead "C:\Users\Frank\Desktop\htmlTest.txt" "All" "[myLoadStr]"
BrowserLoadFromStr "WebBrowser1" "[myLoadStr]"

1 Text Entry 1: Variable = [myurl]

1 WebBrowser; html code loaded by the browserloadfromstr command using an external txt file.

1 Eternal TXT file with following code;
<script language="JScript">

<OBJECT id="VIDEO" width="320" height="240"
style="position:absolute; left:0;top:0;"

<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="full">
<PARAM name="PlayCount" value="9999">

When the file is executed, line 13 of the text file is rewritten with the url variable the user enters into the textentry element then read and loaded by fileread and browserloadfromstr commands.

My goal is to eliminate the external file and embed it into the publication itself. Read the code from a variable and change the url variable manually and also retrieve it via a database allowing the end-user to save and edit the url.

The above coding is the only way I can figure to do this. The data base routine is incomplete at this time. I am not accustomed to writing java or html but know just enough to get by for my own personal uses.
Ultamitly I want the html code read once then the url changed when needed without writing to or reading any external media for the actual execution to occur. The saved url will be exacuted in the same maner by selecting it rather than entering it into a variable field.

Is there a way to assign a neobook variable to memory then send it to the <PARAM NAME=”URL”VALUE=””> using something like


without writing it to an external file.

The purpose of this publication is to allow flexibility to playing media locally or over the internet. It could also use alternative players such as quicktime and realplayer. Neobooks ability to use html locally (without an internet connection) makes it a wonderful tool for multi media types structured to the endusers system based on their installed drivers. If this not detected then try this… so on and so on. It elemenates the possabilities of having to use a plugin.

I do not like to use plugins for my publications.

I like software that requires no add-ons or plugins. Just click and enjoy!

Any help would be greatly welcome.

PostPosted: Sun Dec 19, 2010 3:40 am
by Tony Kroos
so what prevents you from using BrowserLoadFromStr? Then you may use any block of code as variable, for example:
and then:
setvar "[URLVALUE]" ""
BrowserLoadFromStr "<html>|<head>|<script language="JScript">...... "

when you want to change [URLVALUE] just use setvar and reload html content.

PostPosted: Sun Dec 19, 2010 7:47 am
by Skywalker
Do you mean write the code using pipes and character codes?

If so.... I have tried that more than once with failure.

again .... my java coding is next to nill inside neobook.

The worst thing is my vision is even poorer :oops:

but I can now see how it would work for this simple application.

Thank you for your reply.

PostPosted: Sun Dec 19, 2010 11:10 am
by Tony Kroos
Skywalker wrote:Do you mean write the code using pipes and character codes?
If so.... I have tried that more than once with failure.

Why? check this sample pub, it works:
When you change url path just reload html. Also, you can use javascript with BrowserExecScript to change url value in html code without reloading. I can't see any problems to do what you want... maybe I'm missing something?

PostPosted: Mon Dec 20, 2010 6:23 am
by Skywalker
Thanks again.

You're not missing anything. It's my eyes that are missing things.

I have done as you suggested and it does exactly what I want now!

Thanks for your help.

Happy Holidays!