opening pdf files on top of interface
A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 33

Thread: opening pdf files on top of interface

  1. #1
    Member
    Join Date
    May 2004
    Posts
    41

    opening pdf files on top of interface

    I am having a problem and I hope someone can help.
    I am trying to open pdf files from my flash projector on top of the interface. A few problems...
    1- using *********** jstart opens the files below the interface. (This app works well with word docs and excel files though)
    2- flashgeek opens on top, but if the user clicks back on the interface the file disappears below and when the try to click it again, it remains below the interface. The user has to escape or quit to reaccess the file.

    I am not sure how "topmost" works and I am not an expert on actionscript.
    I need the file to open on top every time whether it is open below or not.
    Is this possible???
    Any help would be greatly appreciated
    Thanks so much!!!
    heidivandy

  2. #2
    ...domo... chrismitchell's Avatar
    Join Date
    Mar 2001
    Location
    ...
    Posts
    329
    if you download topmost from http://www.extendingflash.com/utilities/topmost.html then in the actions for the whole projector put the following code:

    fscommand("EXEC", "topmost.exe" + chr(9) + "pdf");

    just make sure the pdf's are all located in a folder called fscommand.

    You may need to get the PDF to be called through a .bat file.

    I will put the code for the .bat file up if it is needed.

    This works for me.

    Christopher Mitchell
    Last edited by chrismitchell; 02-21-2006 at 10:04 PM.
    "All men are equal. All men, that is, who possess umbrellas."
    E.M. Forster

  3. #3
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    Oh heidi, didn't you just buy SWF Studio? If you are using SWF Studio for this project you don't need any of those external tools, you can do it all with SWF Studio. If this is an older project you're working on, let me know and I'll explain how to use topmost or one of my other FREE tools to do what you want. The fscommand chirsmitchell showed you above won't work (unless you're using Flash 5) if you've been banging your head on that one

  4. #4
    Member
    Join Date
    May 2004
    Posts
    41
    Could you please post the code for the .bat file. It would be greatly appreciated.
    THanks
    heidivandy

  5. #5
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    Here's a BAT file that will make sure the Acrobat Reader is made the topmost application after your PDF file is opened. It uses a BAT file for loop to repeatedly call topmost so the PDF has time to load. In the BAT file in the ZIP file I attached there are a lot more X's which translates into a better chance of topmost working.
    Code:
    start test.pdf
    set repeat=x x x x x x x x x x x x x x x x x x x x x 
    for %%i in (%repeat%) do call topmost Adobe
    In the ZIP file I also included a file called test.exe which is a renamed copy of my PROXY utility to hide the ugly DOS box that appears when you run a BAT file.

    Put everything in the ZIP file in the fscommand folder, then if you want to just run the BAT file you can just add fscommand("exec", "test.bat"); to your FLA.

    If you use fscommand("exec", "test.exe"); you'll be using the proxy utility to launch the BAT file indirectly. What this does is hide the DOS box that appears when you run a BAT file.

    If you want to open other PDF files, just make copies of TEST.BAT and TEST.EXE and rename them to say MYFILE.BAT and MYFILE.EXE and edit MYFILE.BAT to open the correct PDF file. Then use fscommand("exec", "myfile.exe") to open the PDF.

    You'll need a BAT and EXE file for each PDF file you want to open.

    Clear as mud right?

    If you have any questions, just shout!

    Note: This would be a one liner (of ActionScript) in SWF Studio
    Attached Files Attached Files
    Last edited by Northcode; 02-22-2006 at 12:21 PM.

  6. #6
    Member
    Join Date
    May 2004
    Posts
    41
    Yes- It worked great! I sent out the CD Yesterday.I can't wait to spend more time learning all SWF Studio can do. I was just curious about the .bat file method - I always hated that ugly black box!!
    Thanks so much!
    heidivandy

  7. #7
    Member
    Join Date
    Aug 2007
    Posts
    47
    First up, thanks to Northcode for posting the solutions to opening word docs. Now I've been trying to address the pdfs-opening-behind problem and I have a few questions...

    What do I do with the 'topmost.exe' file? I have put it in the fscommand folder, but only because there's nothing in the thread to say where to put it.

    Also, does 'topmost.exe' need to be re-named to match the pdf name or left as is? And does the "pdf" part of the fscommand in flash have to be changed to the pdf name?

    Does Northcode's post (featuring the bat file to make Acrobat open in front) supercede the 'topmost.exe' solution?

    Sorry for all the questions, but I've tried everything I can think of.

  8. #8
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    Put all the files in the ZIP file (from the post above) in a folder called fscommand. Put your own projector in the same folder where the fscommand folder is. Your projector should call fscommand("exec", "test.exe") and that should open the test.pdf file in the fscommand folder.

  9. #9

    Arrow Flash exe and Websites

    I think my problem is similar to Heidi Vandy's...

    I have a new cd executed full-screen Flash projector which works well.

    BUT, now I want it to be able to launch websites from this EXE.

    It works OK to click on a button and do something like this:

    on (release) {
    getURL("http://www.website.com", "_blank");
    }
    That will open a website and put the browser in front of the Flash projector which is good.

    BUT, if the user already has a browser open then it does not work! In that case, the websites I launch just load in the background behind the full screen interface.

    Any ideas? Would topmost or something help with this?

  10. #10
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    Topmost would make all the browser instances come to the top so, YES, it would help but you might see multiple browser windows above your projector. That's the only drawback I can think of.

  11. #11

    Unhappy Confusion

    OK, I have topmost.exe in my fscommand folder.

    I can't get it to open any webpages though. All of the examples of topmost usage that I've found are for opening PDFs or other things.

    I currently open my webpages with buttons something like this:

    on (release) {
    getURL("http://www.tacticalpowerplant.com", "_blank");
    }
    Would I need to write something like this?:




    on (release) {
    fscommand("EXEC", "topmost.exe" + chr(9) + "http://www.tacticalpowerplant.com");
    getURL("http://www.tacticalpowerplant.com", "_blank");
    }
    I know that is way wrong...

  12. #12
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    The attached ZIP file includes an FLA with the code below on a button. This launches a URL and then calls browser.exe from the fscommand folder to make any browser windows it finds the topmost windows.

    Code:
    test_btn.onRelease = function()
    {
    	getURL("http://www.northcode.com");
    	fscommand("exec", "browser.exe");
    }
    The browser.exe file (in the fscommand folder) is just a renamed copy of my proxy.exe utility that launches a copy of browser.bat (also in the fscommand folder). The BAT file looks like this.

    Code:
    @echo off
    set repeat=x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x 
    for %%i in (%repeat%) do call topmost Internet Explorer
    for %%i in (%repeat%) do call topmost Mozilla Firefox
    That just calls topmost looking for windows with "Internet Explorer" or "Mozilla Firefox" in their title and makes them topmost. You can add support for other browsers if they have some fixed text in their title bars that topmost can use to identify them.
    Attached Files Attached Files

  13. #13
    Hey Northcode! Thanks again for all your help on this!

    I am using Flash 8, and I think that is causing problems. I couldn't open the web.fla file. It said "Unexpected File Format"

    So, I put the support files in the fscommand folder and tried doing the buttons.
    When I tried to apply your button code to a button in the timeline, I got this error:

    Statement must appear within on handler
    test_btn.onRelease = function()
    I'm going to keep plugging away at this for now...


    I thought this would do it, but it didn't seem to do anything:

    on (release) {
    test_btn.onRelease = function() {
    getURL("http://www.tacticalsolar.com");
    fscommand("exec", "browser.exe");
    };
    }
    Last edited by Graz73; 09-14-2009 at 02:33 PM. Reason: more code clarification

  14. #14
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    Just change your code to this

    Code:
    on (release) {
    getURL("http://www.tacticalsolar.com");
    fscommand("exec", "browser.exe");
    }

  15. #15

    Unhappy nope

    Thanks Northcode, but that doesn't work either.
    I'd already tried this code before I bugged you!?

    Quote Originally Posted by Northcode View Post
    Just change your code to this

    Code:
    on (release) {
    getURL("http://www.tacticalsolar.com");
    fscommand("exec", "browser.exe");
    }
    With your code, or with my original non-topmost buttons, here is what happens:

    I launch my full screen projector interface with web link buttons on it.

    If I click on a link and there are NO web browsers open, then it works just fine, and a web browser pops up with the website in it, in front of the projector.

    BUT if there is already a web browser open, when I push the button to launch a website, it will only work once more!

    After opening a second website, then it will no longer open above the projector interface. No idea why not.

  16. #16
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    I missed the fullscreen part, sorry about that!

    I just retested and I can't make this fail so there's some piece of the puzzle that I'm missing. I saved my FLA down to Flash 8 and made it go fullscreen at startup, it's in the ZIP attachment.

    After opening a second website, then it will no longer open above the projector interface. No idea why not.
    Uhhh, the browser should STILL be above the projector, and it should stay there. The ony way you can "hide" it is to minimize it or close it.

    What OS are you seeing this on? (I'm using XP)
    What browser are you using? (I'm using Firefox 3.0.13)
    Attached Files Attached Files

  17. #17
    I'll try your latest test. Thanks.

    I now see what you mean, that the website should NOT go behind the interface even if I click on the projector. Strange...

    I'm using Windows XP and Firefox 3.5.3

  18. #18
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    The newer version of Firefox may not be putting "Mozilla Firefox" in the title like the BAT file is looking for. If there is some fixed text in the title bar of the browser, change the BAT file to use that to make sure topmost.exe finds it and brings it to the top.

    Firefox keeps telling me that 3.5 is available, I guess I should upgrade sometime

  19. #19
    The version of firefox I'm using DOES put "mozilla Firefox" in the name. For example, this page is:

    Flash Kid Community Forums - Reply to Topic - Mozilla Firefox

  20. #20
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Ottawa
    Posts
    3,697
    If you open a browser and type topmost Mozilla Firefox at the command line, does that make Firefox the topmost window for you?

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

Poll by Flashkit.com