Source language: Translate to:

Assign an URL Param read from memory to an embeded object

Questions and information about using VBScript and JavaScript in NeoBook functions

Moderator: Neosoft Support

Assign an URL Param read from memory to an embeded object

Postby Skywalker » Sat Dec 18, 2010 11:10 pm

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;
<html>
<head>
<script language="JScript">

</script>
</head>
<body>
<OBJECT id="VIDEO" width="320" height="240"
style="position:absolute; left:0;top:0;"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">

<PARAM NAME="URL"VALUE="">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="True">
<PARAM name="uiMode" value="full">
<PARAM name="PlayCount" value="9999">
</OBJECT>
</body>
</html>

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

<PARAM NAME=”URL”VALUE=”[myurl]”>

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.
Never give up trying. Just try it another way that works for you.
User avatar
Skywalker
 
Posts: 50
Joined: Mon Dec 28, 2009 2:19 am
Location: Ohio, USA

Postby Tony Kroos » Sun Dec 19, 2010 3:40 am

so what prevents you from using BrowserLoadFromStr? Then you may use any block of code as variable, for example:
<PARAM NAME="URL"VALUE="[URLVALUE]">
and then:
setvar "[URLVALUE]" "http://stream.com:8000/stream.mp3"
BrowserLoadFromStr "<html>|<head>|<script language="JScript">...... "

when you want to change [URLVALUE] just use setvar and reload html content.
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Postby Skywalker » Sun Dec 19, 2010 7:47 am

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.
Never give up trying. Just try it another way that works for you.
User avatar
Skywalker
 
Posts: 50
Joined: Mon Dec 28, 2009 2:19 am
Location: Ohio, USA

Postby Tony Kroos » Sun Dec 19, 2010 11:10 am

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:
http://www.mediafire.com/?14m6c0k11cukbq5
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?
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Postby Skywalker » Mon Dec 20, 2010 6:23 am

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!
Never give up trying. Just try it another way that works for you.
User avatar
Skywalker
 
Posts: 50
Joined: Mon Dec 28, 2009 2:19 am
Location: Ohio, USA


Return to NeoBook Functions - VBScript & JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest