dcsimg
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Opening Popup Window from Flash on a CDRom

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    10
    I hope the Great Moogly Googly can help! I've tried to open an HTML file in a separate popup window. The Flash file will be distributed on a CD and open several demo courses. I inserted this code in the Get URL field of the dialog box:

    javascript:window.open('c:\A New Office\CDReady\Fountain\Fountainhead.htm','Steve', 'width=800,height=600,top=0,left=0'); void(0);

    However when I try to launch the popup window, I get an error message "Cannot find 'file:///c:ANewOfficeCDReadyFountainFountainhead.htm. Make sure the path or Internet address is correct.

    I know the address is ok, but can't seem to figure out what's wrong.

    The browser address window has this as the address - javascript:window.open('c:\ANewOffice\CDReady\Foun tain\Fountainhead.htm','FountainHead','width=800,h eight=600,top=0,left=0');%20void(0);

    Any suggestions?

    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Hello Steve:

    I have just done something similar on CD. Let me do some work here and I will see if I can duplicate the error you are getting.

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    591
    You know that's only going to work on PCs and only if they copy your CD to their C drive first
    Use links relative to your swf file
    put your html in it's own folder and link to it thusly:
    foldername/yerfile.html

  4. #4
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Ok change you path to this:

    'c:/ANewOffice/CDReady/Fountain/Fountainhead.htm'

    Of course you will have to change the path when you put it on a CD.

  5. #5
    Junior Member
    Join Date
    Jan 2001
    Posts
    10
    I'm not sure if I understand about the drive letter. How can I know what the drive letter is for the CD drive? Is there any way to reference the directory without including the drive letter?

    Thanks,
    Steve

  6. #6
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Ok, when you cut your CD, you need to think about the file structure you want to put in place. Most just put the opening file and its icon in the root directory of the CD - say the CD is on D:, then your directory structure might look something like this:

    D:\
    D:\runme.exe
    D:\runme.ico

    D:\Images
    D:\Images\content1.swf
    D:\Images\content2.htm
    D:\Images\content3.pdf

    etc.

    The point here is don't make more work for yourself than you have to. Keep your directory structure simple. Also, you won't need to specify a drive letter - the system will assume that you are referring to the root directory - which in this case will be the CD - whatever its letter.

    So in Flash, if you are loading a file from the Images Directory, then the directory structure in your code would look something like this:

    ./Images/file1.html

    [Edited by GreatGooglyWoogly on 03-28-2001 at 11:57 AM]

  7. #7
    Junior Member
    Join Date
    Jan 2001
    Posts
    10
    Thanks, I see what you mean. I tried your code for launching the popup windows and I get the following effect.
    When I launch the popup, it actually launches 2 windows, the first shows the Get URL code in the browser address bar, and the browser's display area has the word [object] displayed. Then the second window opens, sized accordingly and in the location I specified. The name of the window doesn't show my name, but Windows Explorer supplied by AOL.

    Any idea why it's opening two windows?

    Here's the code again.

    javascript:window.open('c:/ANewOffice/CDReady/Fountain/Fountainhead.htm','Steve','width=800,height=600,to p=20,left=20'); void(0);

    Thanks for the support.

    Steve

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    Sounds like you have _blank selected in the "Window" type of the getURL command - delete that - there should be nothing in that box.

  9. #9
    Junior Member
    Join Date
    Jan 2001
    Posts
    10
    GGW, please forgive my ignorance, but I can't seem to figure this one out. I have the following setup:

    URL = javascript:window.open('c:/ANewOffice/CDReady/Fountain/Fountainhead.htm','Steve','width=800,height=600,to p=20,left=20'); void(0);

    Window = nothing selected, its blank.

    Variables = Don't send.

    The URL and Windows fields are set to string literals.

    I removed the _blank setting, and it still launches 2 windows. I've even tried all the other settings and it makes no difference.

    Is it possible to use an HTML code instead of java in the URL field. Something like <A href="c:/ANewOffice/CDReady/Fountain/Fountainhead.htm"target="_blank"

    Thanks,
    Steve

  10. #10
    Senior Member
    Join Date
    Sep 2000
    Posts
    1,159
    hhmm, that _blank setting is usually why it launches a second window. Now, your code in your button should look like this:

    on (release) {

    getURL ("javascript:window.open('c:/ANewOffice/CDReady/Fountain/Fountainhead.htm','Steve','width=800,height=600,to p=20,left=20'); void(0);");

    }

    Is that exactly what you have? If it is still giving you problems, then send the files to me and let me see if I can make it work out.

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