A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: ::: Url ::::

  1. #1
    Member
    Join Date
    Jan 2003
    Location
    CPU
    Posts
    38

    ::: Url ::::

    is it possible that Flash read the URL of the page?

    if the swf is in http://www.flashkit.com/board/newthread.php it goes to frame number 5...instead if it's in http://www.flashkit.com/board/cow.php it goes in frame 10.....

    is it possible???


    thanx

  2. #2
    Junior Member
    Join Date
    Jul 2001
    Posts
    14
    I think that what you could do is have an if statement that would asign a variable. You would then send that variable to a .txt file on a PHP server. Then in the movie you can have a loadVariablesNum function, and then a final if statement to determine which frame to go to.

  3. #3
    Senior Member
    Join Date
    Apr 2001
    Location
    Candyland
    Posts
    423
    trace(_root._url);

    k.

  4. #4
    Member
    Join Date
    Jan 2003
    Location
    CPU
    Posts
    38
    Originally posted by kay_siegert
    trace(_root._url);

    k.
    yep...but how???

  5. #5
    Senior Member
    Join Date
    Apr 2001
    Location
    Candyland
    Posts
    423
    Code:
    if(_root._url == "http://www.myhost.com/myswffolder/myswf.swf"){
         // do something ...
    }else{
         // do nothing ...
    }
    k.

  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,041
    Hi Kay,

    unfortunately this solution reports the movie's url but not that of the html page.
    In plain words: if you put a cartoon on your site and somebody wants to steal it, the code would simply force the bad webmaster to link to the movie on your server and thereby steal your bandwidth too.
    Some hosts (e.g. geocities) have a technique in place that prevents linking to your images from an outside html page - maybe your host can offer the same on request

    for %20: if this is sort of a menu that should know where it is, you could use
    <embed src="movie.swf?page=cow" ....> or similar in the html pages.


    Musicman

  7. #7
    Senior Member
    Join Date
    Apr 2001
    Location
    Candyland
    Posts
    423
    musicman: yes that´s true. didn´t think of that.

    check this one just one line of code and you get the html url.
    (i don´t know if all browsers support this method)

    make sure you name your movie in the object AND embed tag and set swliveconnect to true (netscape needs it).

    k.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center