use _url.. trace(_url) will retrieve the URL of the SWF file
or send variables thro' the html, not foolproof, but will deter a few,
<OBJECT classid="..."
codebase="..."
id="test_url" >
<PARAM NAME=movie VALUE="test_url.swf?text1=Hello">
<EMBED src="test_url.swf?text1=Hello"
NAME="test_url"
</EMBED>
</OBJECT>
if run from your html - the variable is sent
if not - no variable received
in the swf, check for the variable, text1 == "hello"
stop();
this.onEnterFrame = function(){
if(text1 == "Hello"){
gotoAndStop("ok");
} else { gotoAndStop("stolen"); }
};
or pass the variable through javascript -
<script language = "JavaScript">
<!--
function PassFlash1(){
window.document.test_url.SetVariable("text1", "hello");
}
function PassFlash2(){
window.document.test_url.SetVariable("text2", "world");
}
//-->
</script>
</HEAD>
<BODY onLoad="PassFlash1();PassFlash2();" bgcolor="#FFFFFF">
<OBJECT...id="test_url"...
<EMBED...NAME="test_url"...
in the movie, check for the variables -
this.onEnterFrame = function(){
if(text1 == "hello" && text2 == "world"){
gotoAndStop("ok");
} else { gotoAndStop("stolen"); }
};
hth
[quoted text, click to view] "Nan R" <geoff@artweb.com.au> wrote in message
news:c0aate$mhv$1@forums.macromedia.com...
> I was wondering if there is a way to get the current page's url string via
> Flash. I want to be sure my Flash file is only played on a particular
> page... stop it being stolen and used elsewhere..
>
> Any ideas?
>
> Nan
>
>