dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: a_modified_dog (your url detection script help please)

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    75

    a_modified_dog (your url detection script help please)

    I found a script your wrote for someone else that is supposed to detect what URL you are currently on and display it on the page.

    I went to test the script and nothing shows up.

    Can you help out?

    Code:
    str = _url;
        id = str.lastIndexOf('/');
        endStr = str.substring(0, id);
        urlTxt.text = endStr;
    I have the detection script set up at
    http://www.spectacularstuff.com/test...-url-test.html

    Attached is the file.

    Thanks for any help. This is actually written in ActionScript 2.0. I need something for 3.0 however getting this to actually display the URL is a step in the right direction.

    Wayne
    Attached Files Attached Files

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    this is my online test file (Flash 8 AS 2.0)

    http://www.jackleaman.co.uk/test/url/urlText.html

    how does it differ from yours ?

    ps..cannot open your fla...Flash 9 ??? only F8 here

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    75
    Thanks,

    I only had the first part of the code.
    That is doing exactly what I need.

    I will have to see if that will work for ActionScript 3.0.

    Thanks Again.

    Wayne

  4. #4
    Member
    Join Date
    Sep 2007
    Posts
    75
    Would you be able to attach the fla file so I can break that down. I would really appreciate that. I have a couple of questions that I think can be answered by reviewing it.

    I am not sure what I am doing wrong because I have the same exact things you have and it does not work for me. There must be something in the fla that I am not doing correctly.

    http://www.spectacularstuff.com/test...-url-test.html

    Thanks,

    Wayne
    Last edited by SpectacularStuf; 09-15-2007 at 11:58 AM.

  5. #5
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    file attached
    let me know how you get on
    Last edited by a_modified_dog; 12-23-2007 at 09:41 AM.

  6. #6
    Member
    Join Date
    Sep 2007
    Posts
    75
    Okay,

    I now know what I was doing wrong. I just don't know why.

    I was encapsulating the text into a movie clip. You have the text added directly to the stage.

    You also have your str as a variable vs. an instance name while everything else is an instance name. I am unsure what difference that makes because everything you have works.

    For whatever reason if you put them into a MC even setup exactly how you have them set up, it does not work. I am not sure why. If you know please explain. If you add them directly to the stage, it works no problem....

    You stated that you have 8.0.... Do you happen to know anything about ActionScript 3.0 or no?

    Thanks


    Wayne

  7. #7
    Member
    Join Date
    Sep 2007
    Posts
    75
    Woo-Hoo. It took a lot of researching for such a simple line... lol Nobody out there has anything that says URL DETECTION onn the pages....

    In Flash CS3 in order to detect and display the URL that loads the SWF file utilize the following:

    1. Create a Dynamic Text Box directly on the stage with an Instance Name something like url_display

    2. In the Property Inspector click Embed and check, upper, lower and punctuation.

    3. Create a new layer named Actions

    4. In that layer put your actionscript. The following magical line:

    Code:
    url_display.text = this.root.loaderInfo.url;
    That will display the current URL onto the webpage. You can also store that information into a variable and use it within your flash file like I am going to do. Have a great day and thank you everyone for your help.

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