How to make sure that the file is displayed on a single url? SOLVED


(Alessandro) #1

Hi, I would use an hype files within a private area, importing it, including it, in a reserved page.
To avoid making visible outside of this page, I would like it to be carried out a check, type:

if main URL: “correct url” go to the scene.
else “go to url”

Can you help me?
Thank you for any help you can provide me … treating me like a newbie
Alessandro


(Mark Hunte) #2

What do you mean by this.?

Are you loading the hype page via iFrame into a private page and want to check the parent hostname/ URL


(Alessandro) #3

I’m sorry, maybe I was too vague.
I have developed a page with hype3, as part of a course reserved for some users.
The site is developed in wordpress in a reserved pages managed with “optimizePress”. Inside these pages insert, including it, the html files developed with “hype3”.
The problem is created if the html file (developed with hype3) opened by itself, not from the page in which it was included.
For this reason I would need a script that when loading the scene, read the main page url. If correct, if it is the secure page, it’s all right. If the main page is different from that protected, the user is sent to the registration page (or other).
Practically a redirection script, if the page is properly opened the next scene. If wrong, the main page switch to other.

I was able to be more clear? :slight_smile:

Something like this:

if “main.self.location.href”= correctPage
then
goto scene02
else
goto main.URL

(Alessandro) #4

I used this:

    if(
    window.location.href=="MY private URL"
    )
    {
//test alert   
 alert("Yes, the url is correct!");
    hypeDocument.showNextScene(hypeDocument.kSceneTransitionCrossfade, 1.1)
    /* some code to load */
    }else{
//test alert
    alert("the url it's wrong");
    hypeDocument.continueTimelineNamed('play the scene and go to other link', hypeDocument.kDirectionForward)
    }
    urlCheck() /* autoLoadFunction */

thanks anyway :smiley: