dynamically embedding objects in html

Discussion in 'HTML' started by krupa.p@gmail.com, Jun 20, 2006.

  1. Guest

    Hi All,

    I am a newbie in html coding. I am writing an application in C# for
    Windows CE device. I need to navigate to a html page in my application.
    I also need to embed flash movies in the html page dyamically. Is there
    a way I can pass the name and path of the flash movie through the url?
    Or any other way to achieve my goal?

    Thanks,
    Krupa
     
    , Jun 20, 2006
    #1
    1. Advertising

  2. jojo Guest

    schrieb:
    > Hi All,
    >
    > I am a newbie in html coding. I am writing an application in C# for
    > Windows CE device. I need to navigate to a html page in my application.
    > I also need to embed flash movies in the html page dyamically. Is there
    > a way I can pass the name and path of the flash movie through the url?
    > Or any other way to achieve my goal?
    >
    > Thanks,
    > Krupa
    >

    I'm not sure if I got your question right, but if it was "How can I tell
    the webpage which file to embed?" than I can help you:

    www.somepage.com/somefile.htm?theUrlToLoad

    The String behind the ? can be read by several script-languages, server-
    and client-side.
     
    jojo, Jun 20, 2006
    #2
    1. Advertising

  3. Guest

    Yes, that was what I was trying to ask. Could you give me some more
    details on how to read the query string I pass in the url?

    Say, my html page is "/Storage Card/Flash/GPSRanger.html", and the
    flash movie I need to play is test.swf. Is the following correct?

    /Storage Card/Flash/myHTML.html?movie=test.swf

    In myHTML.html, I need to embed test.swf. Could you please give me a
    sample code which decodes my query string and embeds the swf file I
    sent?

    Thanks,
    Krupa

    jojo wrote:
    > schrieb:
    > > Hi All,
    > >
    > > I am a newbie in html coding. I am writing an application in C# for
    > > Windows CE device. I need to navigate to a html page in my application.
    > > I also need to embed flash movies in the html page dyamically. Is there
    > > a way I can pass the name and path of the flash movie through the url?
    > > Or any other way to achieve my goal?
    > >
    > > Thanks,
    > > Krupa
    > >

    > I'm not sure if I got your question right, but if it was "How can I tell
    > the webpage which file to embed?" than I can help you:
    >
    > www.somepage.com/somefile.htm?theUrlToLoad
    >
    > The String behind the ? can be read by several script-languages, server-
    > and client-side.
     
    , Jun 20, 2006
    #3
  4. jojo Guest

    schrieb:
    > jojo wrote:
    >> schrieb:


    >>> I also need to embed flash movies in the html page dyamically. Is

    there a way I can pass the name and path of the flash movie through the url?
    >>> Or any other way to achieve my goal?
    >>>

    >> I'm not sure if I got your question right, but if it was "How can I

    tell the webpage which file to embed?" than I can help you:
    >>
    >> www.somepage.com/somefile.htm?theUrlToLoad
    >>
    >> The String behind the ? can be read by several script-languages,

    server- and client-side.
    >
    > Yes, that was what I was trying to ask. Could you give me some more
    > details on how to read the query string I pass in the url?
    >
    > Say, my html page is "/Storage Card/Flash/GPSRanger.html", and the
    > flash movie I need to play is test.swf. Is the following correct?
    >
    > /Storage Card/Flash/myHTML.html?movie=test.swf


    You have to type the URL as normal, just add ?test.swf:
    www.somepage.com/Storage Card/Flash/myHTML.html?test.swf

    Or do you want to view the HTML-Page offline? Than the URL would be
    file:///C:/Path/to/site.htm?test.swf

    > In myHTML.html, I need to embed test.swf. Could you please give me a
    > sample code which decodes my query string and embeds the swf file I
    > sent?


    If I should tell you how to read the query string I first have to know
    if the site is loaded from the web or from your computer, because if you
    load a local file you cannot use server-side scripts.

    >
    > Thanks,
    > Krupa
    >
     
    jojo, Jun 20, 2006
    #4
  5. Guest

    I am not using any web server. I am loading the html page locally from
    my computer. Probably I need some Java scripting to be done, right?

    jojo wrote:
    > schrieb:
    > > jojo wrote:
    > >> schrieb:

    >
    > >>> I also need to embed flash movies in the html page dyamically. Is

    > there a way I can pass the name and path of the flash movie through the url?
    > >>> Or any other way to achieve my goal?
    > >>>
    > >> I'm not sure if I got your question right, but if it was "How can I

    > tell the webpage which file to embed?" than I can help you:
    > >>
    > >> www.somepage.com/somefile.htm?theUrlToLoad
    > >>
    > >> The String behind the ? can be read by several script-languages,

    > server- and client-side.
    > >
    > > Yes, that was what I was trying to ask. Could you give me some more
    > > details on how to read the query string I pass in the url?
    > >
    > > Say, my html page is "/Storage Card/Flash/GPSRanger.html", and the
    > > flash movie I need to play is test.swf. Is the following correct?
    > >
    > > /Storage Card/Flash/myHTML.html?movie=test.swf

    >
    > You have to type the URL as normal, just add ?test.swf:
    > www.somepage.com/Storage Card/Flash/myHTML.html?test.swf
    >
    > Or do you want to view the HTML-Page offline? Than the URL would be
    > file:///C:/Path/to/site.htm?test.swf
    >
    > > In myHTML.html, I need to embed test.swf. Could you please give me a
    > > sample code which decodes my query string and embeds the swf file I
    > > sent?

    >
    > If I should tell you how to read the query string I first have to know
    > if the site is loaded from the web or from your computer, because if you
    > load a local file you cannot use server-side scripts.
    >
    > >
    > > Thanks,
    > > Krupa
    > >
     
    , Jun 20, 2006
    #5
  6. jojo Guest

    schrieb:
    > I am not using any web server. I am loading the html page locally from
    > my computer. Probably I need some Java scripting to be done, right?
    >
    > jojo wrote:
    >> schrieb:
    >> > jojo wrote:
    >> >> schrieb:

    >>
    >> >>> I also need to embed flash movies in the html page dyamically. Is

    >> there a way I can pass the name and path of the flash movie through the url?
    >> >>> Or any other way to achieve my goal?
    >> >>>
    >> >> I'm not sure if I got your question right, but if it was "How can I

    >> tell the webpage which file to embed?" than I can help you:
    >> >>
    >> >> www.somepage.com/somefile.htm?theUrlToLoad
    >> >>
    >> >> The String behind the ? can be read by several script-languages,

    >> server- and client-side.
    >> >
    >>> Yes, that was what I was trying to ask. Could you give me some more
    >>> details on how to read the query string I pass in the url?
    >>>
    >>> Say, my html page is "/Storage Card/Flash/GPSRanger.html", and the
    >>> flash movie I need to play is test.swf. Is the following correct?
    >>>
    >>> /Storage Card/Flash/myHTML.html?movie=test.swf

    >> You have to type the URL as normal, just add ?test.swf:
    >> www.somepage.com/Storage Card/Flash/myHTML.html?test.swf
    >>
    >> Or do you want to view the HTML-Page offline? Than the URL would be
    >> file:///C:/Path/to/site.htm?test.swf
    >>
    >>> In myHTML.html, I need to embed test.swf. Could you please give me a
    >>> sample code which decodes my query string and embeds the swf file I
    >>> sent?

    >> If I should tell you how to read the query string I first have to know
    >> if the site is loaded from the web or from your computer, because if you
    >> load a local file you cannot use server-side scripts.
    >>
    >>> Thanks,
    >>> Krupa
    >>>

    >

    Right, you need.
    How do you open the site? If just open the file (lick clicking), than I
    do not no if you can use the query string. If it does not work try to
    view the page by opening InternetExplorer with the URL as opening
    parameter. You could test: try to open the file first the way you wanted
    to do (/Storage Card/Flash/myHTML.html?test.swf) and if the Browser does
    not view the query string in the address-bar it doesn't work. Quite
    simple ;-)
    I'm going to send you a script which use the query String to embed your
    movie, but I'll need some time to write it.
     
    jojo, Jun 20, 2006
    #6
  7. Guest

    Thanks Jojo! I plan to open the html page from my application. I have a
    browser control embedded in my application. It works when I just pass
    /Storage Card/Flash/GPSRanger.html as the url. In the html page I have
    the following:

    <object
    classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
    width="320"
    height="240" id="GPSRanger"
    align="top">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="GPSRanger.swf" />
    <param name="loop" value="false" />
    <embed src="test.swf" loop="false" quality="high" scale="noscale"
    salign="lt" bgcolor="#ffffff" width="320" height="240" name="GPSRanger"
    align="top" allowScriptAccess="sameDomain"
    type="application/x-shockwave-flash"
    pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>

    But I dont want to hard-code the src of the embedded object.

    I am looking forward to your script.



    jojo wrote:
    > schrieb:
    > > I am not using any web server. I am loading the html page locally from
    > > my computer. Probably I need some Java scripting to be done, right?
    > >
    > > jojo wrote:
    > >> schrieb:
    > >> > jojo wrote:
    > >> >> schrieb:
    > >>
    > >> >>> I also need to embed flash movies in the html page dyamically. Is
    > >> there a way I can pass the name and path of the flash movie through the url?
    > >> >>> Or any other way to achieve my goal?
    > >> >>>
    > >> >> I'm not sure if I got your question right, but if it was "How can I
    > >> tell the webpage which file to embed?" than I can help you:
    > >> >>
    > >> >> www.somepage.com/somefile.htm?theUrlToLoad
    > >> >>
    > >> >> The String behind the ? can be read by several script-languages,
    > >> server- and client-side.
    > >> >
    > >>> Yes, that was what I was trying to ask. Could you give me some more
    > >>> details on how to read the query string I pass in the url?
    > >>>
    > >>> Say, my html page is "/Storage Card/Flash/GPSRanger.html", and the
    > >>> flash movie I need to play is test.swf. Is the following correct?
    > >>>
    > >>> /Storage Card/Flash/myHTML.html?movie=test.swf
    > >> You have to type the URL as normal, just add ?test.swf:
    > >> www.somepage.com/Storage Card/Flash/myHTML.html?test.swf
    > >>
    > >> Or do you want to view the HTML-Page offline? Than the URL would be
    > >> file:///C:/Path/to/site.htm?test.swf
    > >>
    > >>> In myHTML.html, I need to embed test.swf. Could you please give me a
    > >>> sample code which decodes my query string and embeds the swf file I
    > >>> sent?
    > >> If I should tell you how to read the query string I first have to know
    > >> if the site is loaded from the web or from your computer, because if you
    > >> load a local file you cannot use server-side scripts.
    > >>
    > >>> Thanks,
    > >>> Krupa
    > >>>

    > >

    > Right, you need.
    > How do you open the site? If just open the file (lick clicking), than I
    > do not no if you can use the query string. If it does not work try to
    > view the page by opening InternetExplorer with the URL as opening
    > parameter. You could test: try to open the file first the way you wanted
    > to do (/Storage Card/Flash/myHTML.html?test.swf) and if the Browser does
    > not view the query string in the address-bar it doesn't work. Quite
    > simple ;-)
    > I'm going to send you a script which use the query String to embed your
    > movie, but I'll need some time to write it.
     
    , Jun 20, 2006
    #7
  8. jojo Guest

    BTW: your messages are hard to read cause you use the "text above,
    fullquote below" quoting, which is very unpopular in the usenet...
    Please read one of those "quoting FAQs",
    www.netmeister.org/news/learn2quote2.html for example.
    I corrected it in my last postings to increase readability, but I'm
    tired of spending my time for correcting quotes, so please take care of
    advise.
     
    jojo, Jun 20, 2006
    #8
  9. jojo Guest

    schrieb:
    > Thanks Jojo! I plan to open the html page from my application. I have a
    > browser control embedded in my application. It works when I just pass
    > /Storage Card/Flash/GPSRanger.html as the url. In the html page I have
    > the following:
    >
    > <object
    > classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
    > codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
    > width="320"
    > height="240" id="GPSRanger"
    > align="top">
    > <param name="allowScriptAccess" value="sameDomain" />
    > <param name="movie" value="GPSRanger.swf" />
    > <param name="loop" value="false" />
    > <embed src="test.swf" loop="false" quality="high" scale="noscale"
    > salign="lt" bgcolor="#ffffff" width="320" height="240" name="GPSRanger"
    > align="top" allowScriptAccess="sameDomain"
    > type="application/x-shockwave-flash"
    > pluginspage="http://www.macromedia.com/go/getflashplayer" />
    > </object>
    >
    > But I dont want to hard-code the src of the embedded object.
    >
    > I am looking forward to your script.
    >
    >
    >
    > jojo wrote:
    >> schrieb:
    >>> I am not using any web server. I am loading the html page locally from
    >>> my computer. Probably I need some Java scripting to be done, right?
    >>>
    >>> jojo wrote:
    >>>> schrieb:
    >>>> > jojo wrote:
    >>>> >> schrieb:
    >>>>
    >>>> >>> I also need to embed flash movies in the html page dyamically. Is
    >>>> there a way I can pass the name and path of the flash movie through the url?
    >>>> >>> Or any other way to achieve my goal?
    >>>> >>>
    >>>> >> I'm not sure if I got your question right, but if it was "How can I
    >>>> tell the webpage which file to embed?" than I can help you:
    >>>> >>
    >>>> >> www.somepage.com/somefile.htm?theUrlToLoad
    >>>> >>
    >>>> >> The String behind the ? can be read by several script-languages,
    >>>> server- and client-side.
    >>>> >
    >>>>> Yes, that was what I was trying to ask. Could you give me some more
    >>>>> details on how to read the query string I pass in the url?
    >>>>>
    >>>>> Say, my html page is "/Storage Card/Flash/GPSRanger.html", and the
    >>>>> flash movie I need to play is test.swf. Is the following correct?
    >>>>>
    >>>>> /Storage Card/Flash/myHTML.html?movie=test.swf
    >>>> You have to type the URL as normal, just add ?test.swf:
    >>>> www.somepage.com/Storage Card/Flash/myHTML.html?test.swf
    >>>>
    >>>> Or do you want to view the HTML-Page offline? Than the URL would be
    >>>> file:///C:/Path/to/site.htm?test.swf
    >>>>
    >>>>> In myHTML.html, I need to embed test.swf. Could you please give me a
    >>>>> sample code which decodes my query string and embeds the swf file I
    >>>>> sent?
    >>>> If I should tell you how to read the query string I first have to know
    >>>> if the site is loaded from the web or from your computer, because if you
    >>>> load a local file you cannot use server-side scripts.
    >>>>
    >>>>> Thanks,
    >>>>> Krupa
    >>>>>

    >> Right, you need.
    >> How do you open the site? If just open the file (lick clicking), than I
    >> do not no if you can use the query string. If it does not work try to
    >> view the page by opening InternetExplorer with the URL as opening
    >> parameter. You could test: try to open the file first the way you wanted
    >> to do (/Storage Card/Flash/myHTML.html?test.swf) and if the Browser does
    >> not view the query string in the address-bar it doesn't work. Quite
    >> simple ;-)
    >> I'm going to send you a script which use the query String to embed your
    >> movie, but I'll need some time to write it.

    >

    OK, my script is ready, but I havn't tried yet. If something doesn't
    work just tell me and I try to fix it.

    First replace the src="test.swf" in the embeded-tag by id="movie".
    Than add following code into your HTML-head:

    <script language="javascript" type="text/javascript">
    document.getElementById("movie").src=location.href.substr(location.href.lastIndexOf("?")+1)
    </script>

    I hope it works...
     
    jojo, Jun 20, 2006
    #9
  10. Guest

    Thanks a lot Jojo. It worked perfectly when I placed the url in the
    address bar and opened it :)

    However, when I pass the url from my application to the browser it is
    giving an unknown exception. I will try to debug it.

    Thanks again for your help!


    > OK, my script is ready, but I havn't tried yet. If something doesn't
    > work just tell me and I try to fix it.
    >
    > First replace the src="test.swf" in the embeded-tag by id="movie".
    > Than add following code into your HTML-head:
    >
    > <script language="javascript" type="text/javascript">
    > document.getElementById("movie").src=location.href.substr(location.href.lastIndexOf("?")+1)
    > </script>
    >
    > I hope it works...
     
    , Jun 20, 2006
    #10
  11. jojo Guest

    schrieb:
    > Thanks a lot Jojo. It worked perfectly when I placed the url in the
    > address bar and opened it :)
    >
    > However, when I pass the url from my application to the browser it is
    > giving an unknown exception. I will try to debug it.
    >
    > Thanks again for your help!
    >
    >
    >> OK, my script is ready, but I havn't tried yet. If something doesn't
    >> work just tell me and I try to fix it.
    >>
    >> First replace the src="test.swf" in the embeded-tag by id="movie".
    >> Than add following code into your HTML-head:
    >>
    >> <script language="javascript" type="text/javascript">
    >> document.getElementById("movie").src=location.href.substr(location.href.lastIndexOf("?")+1)
    >> </script>
    >>
    >> I hope it works...

    >

    I had the problem too when the address-bar included only the filename
    (C:\SomeDirectory\Somefile.htm?test.swf). Is that the case?
    The URL has to look like this:
    (file:///C:/SomeDirectory/Somefile.htm?test.swf)
     
    jojo, Jun 20, 2006
    #11
  12. Guest

    No, that is not the case.

    I think it has got something to do with the web browser control that I
    have in my application (I am writing a c# app on compact framework 2.0
    for a Windows CE device). It works perfectly on the Internet Explorer
    on the computer.



    > >

    > I had the problem too when the address-bar included only the filename
    > (C:\SomeDirectory\Somefile.htm?test.swf). Is that the case?
    > The URL has to look like this:
    > (file:///C:/SomeDirectory/Somefile.htm?test.swf)
     
    , Jun 21, 2006
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    598
    Travis Newbury
    Sep 13, 2006
  2. Guest
    Replies:
    2
    Views:
    346
    Guest
    Dec 26, 2006
  3. 7stud
    Replies:
    11
    Views:
    729
    Dennis Lee Bieber
    Mar 20, 2007
  4. DartGuru
    Replies:
    4
    Views:
    2,718
    Chaddy2222
    Oct 23, 2007
  5. Replies:
    5
    Views:
    558
Loading...

Share This Page