-
an old dog learning new tricks
document referrer in flash ?
hi,
is there any way to get the document referrer in flash without passing it through javascript or params. I wan't to prevent deep linking to swf files containing images and guess the best way is for the swf file to check it has been loaded from html which is hosted on my own isp but I don't know how to do that.
percepts
-
Registered User
hi,
If I understand what you want: prevent other people from using your movies, you can use the _url property of the MovieClip Class:
code:
var myURL = "http://www.myDOmain.com";
var thisURL = this._url;
if (thisURL.indexOf(myURL) == -1) {
// not allowed
}
else {
// everything is ok, you can see the movie
}
-
an old dog learning new tricks
-
an old dog learning new tricks
just tried this but it's not what I need. Your code would stop someone from copying my movie and putting it on their server but it won't stop them from placing a link to my movie in their website.
eg. object data="http://www.mydomain.com/mymovie.swf" ....
percepts
-
Registered User
I see.
Using the referer:
- flash alone can't do it
- it can be spoofed
- it may not exist (because of a browser or firewall)
If you want to try to make sure that the user came from another page, you can set a variable there, or a cookie, or a session, or have a flash movie that creates a SharedObject...
My webhost also has a feature (that can be enabled in cPanel) to prevent that. Don't know how effective it is.
-
an old dog learning new tricks
there's an option in apache .htaccess file to stop this. It can be used for jpg, gif, swf or any other file type and stops direct retrieval of those files (deep linking) but most isp's won't allow its use because it generates several file access's for every file requested and so slows server performance.
I guess this is what your cpanel setting does.
percepts
-
an old dog learning new tricks
the object tag has a variable called BaseHref in the IE DOM which contains the url of the html which the object tag is inside. Is that variable accessible from within flash ?
e.g object id="objid" data="myswf.swf" ......
in flash is it possible to access objid.BaseHref in any way?
percepts
-
Registered User
That I have no idea.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|