On Sat, 29 May 2004 22:39:18 +0000 (UTC), in macromedia.flash
[quoted text, click to view] "flashin" <webforumsuser@macromedia.com> wrote:
>| I have a flash movie embedded in html page. But I only want the movie to be
>| played locally. I have to use html since I need some javescripting. Since the
>| movie is embedded in html. the users can play it over the net. In order to stop
>| the user from playing it over the net, I want to find way to detect if the
>| movie html page is opened locally or remotely, so that I can do something like
>| this in flash:
>|
>| if (the move not run locally) {
>| warn the user and then exit
>| }
>|
>| How to detect if the movie is played locally or remotely? In order words, how
>| to make sure an html page can only be opened locally? Are there other
>| alternatives to solve my problem?
You could use javascripting on your web page. Place your movies into a
div
<div id="movie01" style="display:block">
<!-- movie object goes here -->
</div>
<div id="movie02" style="display:block">
<!-- movie object goes here -->
</div>
After your </html> tag place the following script.
<script type="text/javascript">
var loc = document.location.href;
if( loc.indexOf("http") >= 0 )
{
//--- hide all div's with and id of movie???
var x = document.getElementsByTagName("DIV");
var n = new String();
// --- turn off all other named divs
for(var i=0; i<x.length; i++)
{
//--- get the idname of the tag
n = x[i].id;
if( n.indexOf("movie") != -1)
x[i].style.display = "none";
}
}
</script>
This will hide the divs from the user. They are still running in the
background. ANy experienced user will be able to circumvent this but
that's the nature of javascript.
Oh BTW, this will work in DOM2 compliant browswer.
HTH
---------------------------------------------------------------
jnorth@yourpantsbigpond.net.au : Remove your pants to reply