dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: is this code right for a pop up browser window?

  1. #1

    is this code right for a pop up browser window?

    Hello

    I was hoping someone could help me out as I am stumpped with this browser popup problem.

    I want to open a pop up window in a browser through a button in a flash movie. The flash movie will be playing on its own ( that is not embedded in an html file)

    I tried using the code and information found here:
    Pop Up Windows In Flash With Javascript

    I put a file called pdf.txt in the same directory on my computer as the flash movie (SWF).

    here is the code I have attached to a button in the movie:

    on (press) {
    getURL("javascript:NewWindow=window.open('pdf.txt' ,'newWin','width=400,height=300,left=0,top=0,toolb ar=No,location=No,scrollbars=No,status=No,resizabl e=No,fullscreen=No');NewWindow.focus();void(0);");
    }
    Does anyone have any ideas why this wont work?

    I am using Flash MX and IE6.0 installed on my system. Also I am running Windows 2000.

    What happens when I test it out is that it seems like the browser window is repeatedly trying to load... but the way to describe it is its like it is stuttering.

    Any ideas or help or info on another tutorial to do this would be tremendously appreaciated.

    Thanks so much for your time and help.

    Eric B
    AJ2000 http://www.aj2000.com

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Rather than just 'pdf.txt' try the full url. It works fine for me with 'http://www.google.com/', for example.

  3. #3
    that does work for me too... as long as you use the full URL to a file located on a web server.

    My problem is that I want this to work locally on my computer... I am making a presentation in flash to work on a CD. So some people viewing this flash presentation they may not be connected to the Internet.

    I tried to use the full path to the file on my machine and that isn't working either.

    Any ways around this?

    Thanks

    Eric B
    AJ2000 http://www.aj2000.com

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Why use getURL then? Have you tried fscommand with "exec" and a batch file to open the pdf? BTW, is it just a text file or a pdf?

  5. #5
    I am not familiar with the fscommand or with "exec" or batch files, where can I find out more?

    The button is going to link to an acrobat (PDF) file.. .I have not created it yet so in the mean time I am just using a text file called pdf.txt ( does the kind of file linking to make any difference?)

    Would you be able to guide me on how to do it for my file, which is located in the same directory as the swf?

    Thanks

    Eric B

    PS this is my first time doing this for a CD and I am taking over someone elses work who quit this job. Thanks.
    AJ2000 http://www.aj2000.com

  6. #6
    Ok i found out a little about FScommands... here
    FSCOMMANDS to launch Internet Explorer

    on (release) {
    fscommand ("exec", "start\texplorer.exe");
    fscommand ("exec", "cmd\t/c\texplorer.exe");
    }

    {
    So I understand that this will launch the browser.. what should I do next ?
    AJ2000 http://www.aj2000.com

  7. #7
    Is this correct????

    on (press) {
    filename = "pdf.txt";
    fscommand ("exec", "start\texplorer.exe" + filename);
    fscommand ("exec", "cmd\t/c\texplorer.exe" + filename);
    }


    And if so how come it is not working for me?

    Thanks

    Eric B
    AJ2000 http://www.aj2000.com

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    This is all assuming your file is in a fact a projector file (.exe) and not a simple .swf.

    Follow the steps in this thread...

    http://www.flashkit.com/board/showth...ghlight=pdf%2A

    This is not opening Explorer, and by the way, new restrictions apply with the fscommand & exec. In your case, the batch file should be located along with the actual .pdf file, in a direct subfolder to the folder where your projector file is located.

  9. #9
    Thanks

    I have been trying but I am not sure if it is me or the fact that I am using Windows 2000 as my OS.

    Could that be it?

    For now I am going to take a break and work on this later tonight or tomorrow.

    Thanks so much

    Eric B
    AJ2000 http://www.aj2000.com

  10. #10
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Pei Pei in that thread was on windows 2000, and got to open his .pdf.
    The only possible problem would be the flash of the DOS window...

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