Can someone help me with a small tutorial on how to fill in the event editor when I want to make a sitelock for www.evilized.nl (I know there's a a get domein object in the flash ext.)
can someone give some sort of example of this.
thanks
Printable View
Can someone help me with a small tutorial on how to fill in the event editor when I want to make a sitelock for www.evilized.nl (I know there's a a get domein object in the flash ext.)
can someone give some sort of example of this.
thanks
You do it with the Flash Player object, not the Get Object. There are several ways to do it, as it depends on the result you wish to achieve. Here are some commented examples to get you started.
Code:// If the domain is "authorized-domain.com" goto Title Screen
// Compare the right part of the string to cover all cases: missing www or subdomains
• Right$(GetWindowDomain$( "Flash® Player" ), Len( "authorized-domain.com" )) = "authorized-domain.com"
- Jump to Frame "Title_Screen"
// Otherwise we display an Ad_Screen
• Timer is greater than 01"-00
- Jump to Frame "Ad_Screen"
Code:// If the domain is different from "authorized-domain.com" we display a warning message
// Compare the right part of the string to cover all cases: missing www or subdomains
• Right$(GetWindowDomain$( "Flash® Player" ), Len( "authorized-domain.com" )) <> "authorized-domain.com"
- "String" : Set alterable string to "This domain is not authorized. Head to authorized-domain.com to play!"
// Otherwise goto Title_Screen
• Timer is greater than 01"-00
- Jump to Frame "Title_Screen"
Thanks for the post :)
your the best
Do you mean the Flash Haxx object? I've tried The Flash Player Object, but it only has 3 conditions ('on javascript error', 'is preloader' and 'local connection').
Do you have a working mmf example lying around that I can take a peek at?
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=184788 :)
Thank you for the link. I ended up not using that widget, but it learned me a lot about the examples shown above. I got my first swf sitelocked :) .
In these sitelocks examples that use Flash Player object, the expression Len is string length right? but wouldn't that mean if another site that wanted to host your SWF was the same string length it would work ok?
No...
Right$(GetWindowDomain$( "Flash® Player" ), Len( "authorized-domain.com" ))
Right("Hello",3) is "llo", the 3 last characters of "Hello".
It checks if the last part of the domian is equal to the domian in the string.
No, you cut out the ending part of the url and compare it with your string. LEN is used to get only the xyz.com part at the end of the url. This way you don't have to care about subdomains like abc.xyz.com
Edit: Looki was faster :)
Although if your domain was xyz.com and someone registered abcxyz.com, they could use it on that domain!
Ah ok so it's actually a string comparison rather than length, that would be fine then as long as they did not do the duplicate domain workaround thing like Jamie says.
I guess to take it a step further you could have text on the website page and then get and compare that also. I doubt anyone wanting to take the SWF would duplicate the whole website page but i haven't researched this much.
Anyway this is good to know, thanks everyone :)
Ouch, that's true! We probably need an additional event first, to check for special characters which mark the end of the domain. Would it be sufficient to look for the second dot from the right side of the url to solve this?
Check if it's either equal to "xyz.com" or if the right is ".xyz.com" - that should work.
> Check if it's either equal to "xyz.com"
I should add "in whole". Because in part should only be ".xyz.com"
If we only check for the ending ".xyz.com", is there any possible url format which could still cause trouble or do we only need to enhance the check by the leading dot?
You need to check for the entire domain being "xyz.com" too, since if the domain is just "xyz.com", the (Right$(...) = ".xyz.com") will be false.
But yes, that's all you need to check.