A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Checking a URL ActionScript 3.0

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    75

    Checking a URL ActionScript 3.0

    I have a 5 tabs that are already complete. I would like to add a script to change the state of the button depending on the URL

    so if I have 5 pages and each tab leads to a page

    We will call the pages
    1. Home (index.htm)
    2. About Us (aboutus.htm)
    3. Services (services.htm)
    4. Specials (specials.htm)
    5. Contact Us (contactus.htm)

    I have attached the completed button that fades in and out as you roll your mouse over and off of it.

    Click on the button and you will see it turn to dark blue. I would like this to be the state of the button based upon whether or not they are on aboutus.htm or services.htm, etc etc etc.

    I have been looking for a solution to this and found how to load a URL but not check the webaddress you are currently on.

    How do I tell ActionScript 3.0 (getURL is no longer available in 3.0) to check the URL and based upon the URL, put the button into the down state?

    Thanks for any insight.

    I found the following in the forums. It looks as if it is actionscript 2.0 however I will see if this will work.

    Code:
    str = _url;
        id = str.lastIndexOf('/');
        endStr = str.substring(0, id);
        urlTxt.text = endStr;
    Wayne
    Attached Files Attached Files
    Last edited by SpectacularStuf; 09-14-2007 at 05:56 PM.

  2. #2
    Member
    Join Date
    Sep 2007
    Posts
    75
    I tried the script above. I must not know enough about it because I could not get it to work. I wrote another posting to the writer to see if they could help shed some light.

    I did find something else that is interesting called FlashVars at the following URL:
    http://www.permadi.com/tutorial/flashVars/

    I can encode the pages in PHP and utilize the flashvars to pass the URL to flash and pick it up from there.

    Wayne
    Last edited by SpectacularStuf; 09-14-2007 at 06:44 PM.

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    75
    Okay, you don't have to utilize flash variables or talk from one language to another.

    This is extremely easy to do... It took a lot of researching to find something so damn simple.

    See the following post:
    http://board.flashkit.com/board/show...12#post3939912

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