Welcome, Guest
  • Author Topic: Stupid Question for the Day...  (Read 2429 times)

    Quasi

    • Server what's that
    • *
    • Posts: 19
      • View Profile
      • Email
    Stupid Question for the Day...
    « on: 09/12/05, 10:48 »
     ??? Okay, don't mock my pain, but here is the stupid question for the day...

      Can you load a .js file into a moviecllip in flash when the .js is actually calling a .swf file onto the page.(Don't ask...)  The Javascript works fine by itself, but when I use something like this:

      MC.getURL("javascript:open('http://whatever.js')");

      ..it simply prints out the .js on the page without actually displaying anything.

     Is this totally retarded or am I just missing something?  Be honest... I'd rather understand than be ig'nant...

    Thanks.

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Stupid Question for the Day...
    « Reply #1 on: 09/12/05, 11:42 »
    You should open an html, this html page could include your js script, that probably write HTML tags on the fly. To include a JS on an html just add something like:

    <script language="JavaScript" src="whatever.js"></script>


    Jorge

    Quasi

    • Server what's that
    • *
    • Posts: 19
      • View Profile
      • Email
    Re: Stupid Question for the Day...
    « Reply #2 on: 09/12/05, 11:55 »
    Thanks for the response, but that doesnt quite answer my question.. as confusing as it is!

      I don't have any problems loading the JS  into an HTML page. But ultimately what the JS does is load a SWF file.(It's this whole ad tracking thing I wont go into.)

      Want I want to do is create a SWF file on the page that can call on this JS  just like an HTML file does, but instead of loading it on the page, it loads it inside a MC inside the SWF file.

      Can I do this directly from the SWF file like this:

      MC.getURL("javascript:open('http://whatever.js')");

     or do I need to define a JS function in the HEAD and call IT from the SWF file like so:

      MC.getURL("javascript:JS()");

     ...assuming of course that this is even possible, which is my real question...  :-\

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Stupid Question for the Day...
    « Reply #3 on: 09/12/05, 12:03 »
    Ah, ok, easy question, you can't. For doing that you should pass the file itself using some back-end that sends proper headers, like PHP or Java.

    Jorge