A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: menu that changes by page its imbeded in...

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Location
    atlanta
    Posts
    123
    I have a menu that I need to change depending on the html or php page it is inbeded in.

    how can i do this. I need the movie clip to gotoAndStop on different frames. Do i input data into html, is there a checkURL command?

    thanks


  2. #2
    OLD New Member
    Join Date
    Aug 2000
    Posts
    37
    there is a thing called an FS Command... you could make a little javascript function to substring off the last part of the URL (after the last /) and return it to the movie, i've never done much/anything with future splash commands, that is what i guess FS stands for.

  3. #3
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202
    there sure is a check url command, and its... (drumroll...) _url . so _level0._url gives you the full http://www.whatever.com/folder/page.html layout. you can use the string object to extract the words you want and redirect your swf.

    Also, as a note on piracy, you can protect your swfs by theives by checking the url, so if the server that's playing the URL is not yours then gotoAndPlay("getLost");

    this only works on playback as hack programs totally overlook it.

    if (_level0._url == "http://www.yourserver.com") {
    gotoAndPlay("intro");
    } else {
    stop();
    }

    however if you publish the SWF it'll now only work on the server and it won't work locally, but the fact it doesn't play then is because the url is something like C:/windows/My Documents as URL works locally too.

  4. #4
    OLD New Member
    Join Date
    Aug 2000
    Posts
    37
    however
    this method only returns the url of the swf and some lousy information about the directories and host, not the HTML or PHP page in which it is embedded.

  5. #5
    Deathbringer sylkro's Avatar
    Join Date
    Oct 2000
    Location
    London
    Posts
    202
    yeah, but that's the point of using the string object. the stuff you don't want is probably at the begining of the returned string so when you use the Object, set your start index to -1 and it'll begin from the end of it.

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