A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: .JS Files???? PLEASE HELP!!!!!!

  1. #1
    iguanagirl32 mraspiller's Avatar
    Join Date
    Jul 2002
    Posts
    817

    getURL???? PLEASE HELP!!!!!!

    Can Flash open .js files? I am trying to do this:

    onClipEvent(load){
    getURL("/alert.js");
    }

    but it is prompting me to download the file, & when I click OK, it give me a syntax error...but I know the code in my JS file is correct...

    I need to load the JavaSript from that file & run it...
    Last edited by mraspiller; 02-21-2003 at 03:49 PM.

  2. #2
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    well, I'm not sure if I am any help, but here is a thought.
    I have always had just a regular html page, and within that html, I have the javaScript CALLING the .js file:

    <script language="JavaScript" src="YOUR FILE HERE.js">
    </script>

    I just toss that in the body, and it should call in whatever file into the html page. Perhaps this will trigger something and help??
    Good luck!
    [something cool goes here]

  3. #3
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    woah.....something messed up there...
    lets try that again. Here is the code:

    script language="JavaScript" src="YOUR FILE HERE.js">
    /script>

    It doesnt like it when i have the correct tags on it, so dont forget to put them in.
    [something cool goes here]

  4. #4
    iguanagirl32 mraspiller's Avatar
    Join Date
    Jul 2002
    Posts
    817
    The problem is that the .js file is just a command that calls a file that basically says, "go to the server, and get/open a file that is sitting there..."

    Make sense?

    When I do what you suggessted, it worked, but it replaced my flash movie...it loaded it into the same window...I tried having it open in a new window, but then it opened another window and I still lost the flash...

  5. #5
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    whats a js file? javascript right? how complicated (how many lines) is the js file?

  6. #6
    iguanagirl32 mraspiller's Avatar
    Join Date
    Jul 2002
    Posts
    817
    It's just one line...

  7. #7
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Originally posted by mraspiller
    It's just one line...
    what is that line?

  8. #8
    iguanagirl32 mraspiller's Avatar
    Join Date
    Jul 2002
    Posts
    817
    Well, I can't give the code out, but let's say it's just an alert box...

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    mraspiller...

    Get rid of that footer line... Will ya?

  10. #10
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    If its in a form or something, you might need tags in the form like:
    action="javaScript:void(0)" or something like that. -- that will keep the window from going anywhere. I am kinda rusty on my javaScript...
    Sorry if i am no help.
    [something cool goes here]

  11. #11
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,789
    Originally posted by mraspiller
    Well, I can't give the code out, but let's say it's just an alert box...
    The reason I asked was if it's only one line you could do something like this:
    Code:
    getURL("javascript:alert('alert');void(0);");

  12. #12
    iguanagirl32 mraspiller's Avatar
    Join Date
    Jul 2002
    Posts
    817
    Biff Tanon...

    Thanks for the help...gonna try what you suggested...

  13. #13
    How should I know!? Biff Tanon's Avatar
    Join Date
    Jun 2001
    Posts
    748
    Originally posted by gSOLO_01
    The reason I asked was if it's only one line you could do something like this:
    Code:
    getURL("javascript:alert('alert');void(0);");
    Ya, something like that!
    [something cool goes here]

  14. #14
    iguanagirl32 mraspiller's Avatar
    Join Date
    Jul 2002
    Posts
    817
    What if the movie is calling a specific file...would it look like this?

    getURL("fileName.js", "void(0);");

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