Dave,
Hopefully the following will help you get closer to your goal.
I tried various things to get this to work and the biggest problem is I
couldn't find a way to make javascript talk back to flash when it's created
in flash. If you have javascript functions on the html page where the flash
object is embedded, you can call the functions and have javascript
communicate back with flash (this would be easy). I'm assuming this isn't
an option for you since you can't expect people to include javascript
scripts in a myspace page (it would be easily bypassed).
What I did is created a new fla and added the following code:
getURL( "javascript:var s = window.location.toString();" );
getURL( "javascript:alert('"+this._url+" - refer: ' + s )" );
getURL( "javascript:(window.document.test.myVar = s;" ); // unfortunately
this doesn't work, it never sends test(my flash object) the var
getURL( "javascript:if(s!='http://127.0.0.1/test.html'){ alert('bad, no
access for you'); }" );
(The swf was copied to another server and the html page was ran from my
machines web server.)
First, set a javascript var that is equal to the url of the
webpage(location)
Then, you could compare that var to the ones that should be allowed. If
they are, don't do anything. If they aren't allowed do something. I was
thinking maybe change the visibility of the object to false so people can't
see/interact with it?
Here's my html page I was testing with incase it helps:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>test</title>
</head>
<body bgcolor="#ffffff">
<p>hi</p>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.
cab#version=8,0,0,0" width="550" height="400" id="test" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="http://www.somedomain.com/test.swf" /><param
name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed
src="http://www.somedomain.com/test.swf" quality="high" bgcolor="#ffffff"
width="550" height="400" name="test" align="middle"
allowScriptAccess="always" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
swLiveConnect="true" />
</object>
<p>bye</p>
</body>
</html>
Let me know if that helps,
Joey Rivera
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com