Create script for a button to open a PDF using AS3

I created a Flash movie in AS3 on the mac. I have several
navigation buttons, I want to be able to click on a button and open
a PDF. The finished movie will be an executable for the pc. I also
want to do the same for a .swf file.

Well, I think I got it working. The code I came up with seems a lot more simple than what I was experimenting with. I am pretty sure I did something earlier that was similar to this code but the current swf stayed with the player when the new one loaded, I am pretty sure the old swf is hiding underneath the new one but after some testing, the actual presentation is working as intended so I am waving the AS3 white flag and am accepting how this functions in its present state. I nearly gave myself a heart attack trying to get this simple function to work
Anyway, heres my "final" code. If anyone sees something that should be adjusted, please let me know.
play_iv.addEventListener(MouseEvent.CLICK, loadmain);
function loadmain(event:MouseEvent):void {
            var prevu_english:Loader = new Loader();
            prevu_english.load(new URLRequest("assets/PreVu - English.swf"));
            addChild(prevu_english);
Also, Thankyou Ned. You pointed me in the right direction. If I didn't keep looking at the loader class, I probably would have spent days doing trial and error until I got somewhere.

Similar Messages

  • Create a DVD with buttons to open the .pdf file with adobe Encore ?

    Dear all !
    I would like to create a DVD or a CD-Rom support with an interactive menu and buttons which allow us to open some files in.pdf.
    It will be a conference DVD with all presentations in. pdf, contact list in .xls file, etc.
    Is it possible to create such a DVD with adobe Encore ?
    Thank you in advance.
    Sév from France.

    You could look around for "eDVD." Going back, it was being developed by Sonic, but they dropped it because of issues with Vista. About every 6 - 8 mos., some little tid-bit comes out, that the code has been bought and someone is working on it.
    Also, Encore CS5 seems to have added some interactivity elements in BD, but I have only seen some bullet points, and zero details. Since Jeff did not make mention of CS5, my guess would be that the interactivity might not have been what you need - or enough details have not been released yet for any of us to know for sure. The full details will be available very soon though.
    Good luck, and hope that whoever did acquire the code from Sonic IS on their way, as this is an oft requested feature.
    Hunt

  • Scripts for adding/deleting/modifying Open Directory accounts?

    I think I have searched high and low for an answer to this question, but if I missed it please point me in the right direction. Where can I find information on scripts for adding/deleting/modifying open directory accounts? At the very least, a command line utility with some syntax guidelines! Any help would be greatly appreciated.

    Hi
    I personally don't know if any scripts although you can use the command line to do pretty much anything you want with the Open Directory. Consult the manual: man dscl. If you launch terminal and issue dscl you should see something like this:
    my-Laptop:~ me$ dscl
    dscl (v20.4)
    usage: dscl [options] [<datasource> [<command>]]
    datasource:
    localhost (default) or
    <hostname> (requires DS proxy support, >= DS-158) or
    <nodename> (Directory Service style node name) or
    <domainname> (NetInfo style domain name)
    options:
    -u <user> authenticate as user (required when using DS Proxy)
    -P <password> authentication password
    -p prompt for password
    -raw don't strip off prefix from DS constants
    -url print record attribute values in URL-style encoding
    -q quiet - no interactive prompt
    commands:
    -read <path> [<key>...]
    -create <record path> [<key> [<val>...]]
    -delete <path> [<key> [<val>...]]
    -list <path> [<key>]
    -append <record path> <key> <val>...
    -merge <record path> <key> <val>...
    -change <record path> <key> <old value> <new value>
    -changei <record path> <key> <value index> <new value>
    -search <path> <key> <val>
    -auth [<user> [<password>]]
    -authonly [<user> [<password>]]
    -passwd <user path> [<new password> | <old password> <new password>]
    Entering interactive mode...
    The above is for 10.4 and should server equally as well for 10.5.
    Hope this helps, Tony

  • Want to take "CREATE script" for all roles existing in DB.

    Hi All,
    I want to take "CREATE script" for all roles existing in DB.
    Please provide me script to generate if you have or suggest any link or doc.
    Oracle 10G

    Use this-
    select 'select dbms_metadata.get_ddl(''ROLE'','''||ROLE||''')||chr(10)||''/'' from dual;'
    from dba_roles
    Please be aware grants will not come in the definition
    If you like the answer then don't forget to give points

  • For the best experience, open this PDF portfolio in Acrobat 9 or Adobe Read

    Hi,
    For the first time I am aware of a user has received a PDF that cannot be opened in Preview.
    The pdf opens to a splash screen showing, "For the best experience, open this PDF portfolio in Acrobat 9 or Adobe Reader 9, or later." There is a large button showing " Get Adobe Reader 9"
    It is a 15Mb document but we cannot get beyond the splash screen in Preview so I have had to install Reader 9 for the user.
    Turns out the document is a very basic slideshow. It seems this is a new (to me) format of PDF which forces users to install Reader.
    Is there any way these image portfolios can be opened within Preview so I don't have to install Adobe Reader bloatware again?
    Thanks,
    b .

    Is there any way these image portfolios can be opened within Preview so I don't have to install Adobe Reader bloatware again?
    I doubt it, but perhaps others have better info...
    You can ask Apple to expand Preview's capabilities here:
    http://www.apple.com/feedback/macosx.html
    Personally I have never found Preview to be a complete substitute for Adobe Reader and always have both on my machine to deal with pdfs, which have a large number of possible variations in terms of version, features, and encodings.

  • I have a button that opens a PDF that crashes Moodle and Scorm Cloud. How can I fix this?

    I'm using adobe Captivate 5.5
    I have a button that opens a PDF that crashes the course when in an LMS (I've tried moodle and scorm cloud). When I play the course in my browser, the file opens fine and the course continues. Does anyone know why opening this file doesn't work when I upload the SCORM package to an LMS?
    Thanks,
    Chris

    Hi aperio_chris,
    Thank you for contacting adobe support.
    Please use the following steps and let us know if that helps:
    1. In the publish setting>>externalize resources>>check all the check box which are for attachment, widget, animation etc.
    2. Check the flash player version change it to version 9 or 10 when publishing the output through Adobe Captivate.
    Thanks and Regards
    Loveesh

  • Unable to open PDF portfolio (Error Msg: "For the best experience, open this PDF portfolio in...)

    I am having a problem opening an important PDF portfolio document using Adobe Reader (version 11.0.02) for Mac (Mountain Lion version 10.8.3).
    When I attempt to open the file, I come up with the error message: "For the best experience, open this PDF portfolio in Acrobat 9 or Adobe Reader 9, or later", and I am unable to view the document. This is becoming very frustrating, as I am attempting to open the document with the new version of Adobe Reader (which I have downloaded multiple times).
    If anyone has a solution for this problem that would be very helpful!
    Thanks in advance.

    Hi,
    Thanks for the reply. No I'm not using iPad, I have a MacBookPro. I just wasn't sure which forum was best to post this question in.
    I have flash but Adobe still won't open my documents.
    Anyway, thanks for your help.
    Lauren

  • Some elements of downloaded PDF not showing (Error: "For the best experience, open this PDF portfolio...")

    I'm on a PC attempting to view a downloaded PDF. It's an application so the document is generated by our online system and aggregates info from the applicant as well as documents they uploaded. I can see most of the final product but the document uploaded by the applicant gives the error "For the best experience, open this PDF portfolio in Acrobat 9 or Adobe Reader 9, or later." I downloaded the latest Reader (DC) and when I searched to download the latest Flash Player I got a message that it should be up-to-date since I use Chrome. I've seen other folks having this problem; any suggestions?? Thanks in advance.

    Thanks for your response! The document appears the same either way. I downloaded the file and have opened it with both Adobe Acrobat and Adobe Acrobat Reader DC.

  • How to make a Word for Mac 2008 doc into a PDF using Acrobat Macintosh

    Any ideas how to turn a Word for Mac 2008 document into a PDF using Acrobat Pro?
    Thank you if you can help.

    In Word  2008 for Mac:
    go to Save As... from File menu.
    when window open click on Button show the current file type.
    when thi menu drops down you will see the following
    Choose PDF
    save.
    Then open up in Acrobat.

  • When i try to open a pdf using int exp i get a message that it has encountered a problem and will cl

    when i try to open a pdf using int exp i get a message that it has encountered a problem and will close

    Internet explorer.  I have adobe reader and flash player which I uninstalled and reinstalled.  I tried another browser and the pdf's open so it is a problem with IE .Thanks for your comments.
    [private data removed]

  • When using more than one tab, once I have opened a pdf using firefox my laptop will not allow me to type or click in another tab unless I drag the pdf into it's own window?

    when using more than one tab, once I have opened a .pdf using firefox my laptop will not allow me to type or click in another tab unless I drag the .pdf into it's own window? not a major problem just irritating.

    I found the cause but no solution, it's actually a plugin that does that: divx plus weblpayer (it gets installed when you install DivX on your system), if you disable it and restart firefox it all works again. But I want that plugin... so DivX need to fix this, unless it is a Firefox bug in its own core... anyway these two together creates the problem.
    (I'm running Firefox 9.x on OSX Lion)
    I also wish firefox tab tear out tab worked more like chrome's tab tear out, much friendlier...

  • Opening a PDF using Acrobat X

    I would like to open a PDF using Acrobat X. I need to input boxes into my PDF form so that the form can be filled out on the computer by typing rather than having to print it out and hand write responses. I have downloaded the trial version of the Acrobat X. When I try to open the PDF with Acrobat X, it doesn't do it and I am unable to make the changes I wish. Any help would be greatly appreciated.
    Thank you.

    When you open the pdf it doesn't do what? If you can open Acrobat you need the form tool. If the form tool is not available under the tools panel, use View->Tools->Forms menu item to make it appear.

  • 'open doc' javascript based on the name of original pdf, e.g. pdf a5.pdf has button to open b5.pdf because script is able to know its '5'

    I hope this makes sense.
    I have two sets of pdfs containing 100+ individual pages (totalling 200 pages in one folder)
    Set/series 1: a1,a2,a3 -----> a100
    Set/series 2: b1,b2,b3------> b100
    I would like to create a button on each page that will open a corresponding page number for the other pdf series.
    so I click on open file location button that is sitting on a50 for example, it will open b50.
    Any tips or clues on how I can execute this? Presumably some smart way of isolating the number (last character) '50' from the existing pdf's name and appending it into the end of the 'b' text to get 'b50' as the file to open?

    This is not something that you can set in the code I provided. There's an app-wide setting that can be set (in principle) using code, but it's not a good idea to change it, because it applies to other documents as well.
    And regarding JS and CodeAcademy: It's always a good idea to try to learn more, but keep in mind that Acrobat JS is quite a niche thing, quite different from the kind of JS that is used in web-pages. You can find more information about it here:
    http://www.adobe.com/devnet/acrobat/javascript.html
    And here:
    http://acrobatusers.com/tutorials

  • How to use the same script for multiple buttons

    Hi,
    I've only just started using flash so any help would be great!
    I'm creating a blockbusters type game, I have a grid of 20 buttons and I need  them (individually) to turn blue on click and red on double click. I've managed to do it with the first one using this code;
    var clicked:Boolean = false;
    bn1.addEventListener(MouseEvent.CLICK, bn1click);
    function bn1click(event:MouseEvent):void {
        clicked = true;
        var newColorTransform:ColorTransform = bn1.transform.colorTransform;
        if(clicked){
        newColorTransform.color = 0x064258;
        bn1.transform.colorTransform = newColorTransform;
    bn1.doubleClickEnabled = true;
    var doubleclicked:Boolean = false;
    bn1.addEventListener(MouseEvent.DOUBLE_CLICK, bn1dclick);
    function bn1dclick(event:MouseEvent):void {
        doubleclicked = true;
        var newColorTransform:ColorTransform = bn1.transform.colorTransform;
        if(clicked){
        newColorTransform.color = 0xac1e23;
        bn1.transform.colorTransform = newColorTransform;
    Now I'm having trouble getting the same to work for the rest of the buttons, they are each named bn2, bn3 etc. They need to work individually and remain blue/red once clicked. I've tried listing them as addEventListener commands but not having a great deal of success!
    Any help would be greatly appreciated, thanks!
    Tomo

    One way to do this is to use arrays to keep track of the buttons and their properties.
    var buttonList:Array = new Array(bn1,bn2,bn3);
    var clickedList:Array = new Array();
    var doubleClickedList:Array = new Array();
    //then use a for loop to assign the functions and properties for each button:
    var thisMany:int = buttonList.length; // this will give you the number of items in the buttonList array
    for(var i:int = 0; i<thisMany; i++) {
         buttonList[i].addEventListener(MouseEvent.CLICK,btnClick); // assign the click function to each button
         buttonList[i].addEventListener(MouseEvent.DOUBLE_CLICK,btnDClick); // assign the double click function
         clickedList.push(false);  // add a false value for each button to this array
         doubleClickedList.push(false);
               buttonList[i].doubleClickEnabled = true; // set the double click property for each button
    function btnClick(event:MouseEvent):void {
              var thisButton:int = buttonList.indexOf(event.target);  // figure out which button was clicked as an item in the array
              clickedList[thisButton] = true;  // change the value in the array
               var newColorTransform:ColorTransform = buttonList[thisButton].transform.colorTransform;
        if(clickedList[thisButton]){
        newColorTransform.color = 0x064258;
        buttonList[thisButton].transform.colorTransform = newColorTransform;
    function btnDClick(event:MouseEvent):void {
              var thisButton:int = buttonList.indexOf(event.target);
              doubleClickedList[thisButton] = true;
        var newColorTransform:ColorTransform = buttonList[thisButton].transform.colorTransform;
        if(doubleClickedList[thisButton]){
        newColorTransform.color = 0xac1e23;
        buttonList[thisButton].transform.colorTransform = newColorTransform;
    Now you can have any number of buttons, just add their instance names to the array at the top.

  • How to create subpicture for a button?

    Hello!
    I have really tried to find the answer to this rather silly problem on my own, but without result. Please help someone!
    The situation:
    I have a menu with three choices: "Play Movie", "Scene Selection" and "Subtitles". Now, the text presenting these choices are part of the background image, created in Premiere (the program I know best). They are written with an old typewriter to get that gritty feeling.
    I want the user to scroll between these "menu items". The currently selected item should be indicated by a black circle/spot/dot before the text of the item. By default, when the menu appears, there is a black circle in front of (to the immediate left of) the item "Play Movie". The user should now be able to step with his/her remote to the other items, thereby making the black circle in front of "Play Movie" disappear and appearing instead before some of the other items. In short: the black circle is always showing before the currently selected item. OK, I got a bit verbose there, but the idea got across hopefully. One more thing: the background color is 100% white.
    Up to this point, my solution was this: I placed black circles (small images with gradation and all, very nice looking) in front of ALL THREE ITEMS. Then I convert these into buttons. Then I choose the color set for the menu so that the unselected state is 100% white, plain and simple, with 100% opacity, thereby covering the black circles that should not show. Only in the selected and activated states does opacity for the button subpicture drop to 0%, thereby revealing the black circle that should be seen.
    The problem? Well, on some DVD-players (not on the XBOX 360 though), when an item is activated, all three circles show for a brief moment before the selected action starts (for example playing the movie). It also happens in Encore Preview. This is not logical at all and looks amateurish. I don't know why it happens, but my guess is that it wouldn't if I did this the "correct" way: by creating subpictures fo the buttons in the shape of circles. I understand the nice looking gradations must go out the window but that is a price I'm willing to pay.
    But now I run into an unexpected problem: I don't understand how to create a subpicture for the button that is a black circle. It seems the documentation in Encore and on forums in general takes for granted that you know how to do this.
    What I tried ws this: I created a monochrome, small image in bmp format - a black circle on white background. But this image just shows up as a black rectangle in Encore.
    What should I do? I should add that I have no real experience with Photoshop, so go slow if you go there.
    Regards,
    Nikolaj

    Basically, when one realizes the limitations of the Sub-picture Highlights, as set by the DVD-specs., it's easy to see the "workaround."
    A couple of the aspects of Sub-picture Highlights are:
    1.) 2-bit color (either ON, or OFF), from a limited color palette, with degrees of Transparency (the opposite of PS's Opacity).
    2.) they will appear on top of anything else on the Menu, including things like Button text/graphics.
    By constructing your Sub-picture Highlight in PS, you can use Masking to define where it will be, and where it will not be. In the case that prompted my article, the poster had a series of Text Buttons, and the Sub-picture Highlights were formed from that Text. The poster did not like the look of those 2-bit jagged blocks of color overlying the Text in the Button. The workaround is to "punch a hole" in the Sub-picture Highlight, so that it is hollow, where the Button's Text appears. This is done in PS, by using the "outline" of that Text to create a Mask for the Sub-picture Highlight. The jagged aspect can be adjusted a bit, by using a degree of Transparency (set in the non-Auto Color Set back in Encore). We still have a 2-bit color Sub-picture Highlight, and it still overlays the Button's Text, but now there is a hole in it, right where the Button's Text is located, and it is seen through that hole. The introduction of Transparency has the visual effect of "softening" the look of the 2-bit color, even though the jagged edges are still there - they just look softer. I went on to show how one could even use a second Sub-picture Highlight, that is just a bit larger than the first, and with more Transparency to simulate a "glow." Now, we cannot have a real "glow," because we are limited to that 2-bit color for the Sub-picture Highlight, but we can simulate it.
    Much of what a designer does is really slight of hand - illusion. They all have to work within the limitations of the DVD (or BD) specs., but with a bit of creativity, planning and some work in PS and Encore, they can create enough smoke and use enough mirrors to fool the user into believing that what they think they see skirt the DVD-specs. They do not, but that's where the illusion comes in.
    We get a lot of questions from people, who claim that one commercial DVD, or another, has full-color Sub-picture Highlights and they complain that Encore cannot do that - only 2-bit Sub-picture Highlights. What they are seeing, but do not realize it, is a dupe Menu, with a full-color graphic, and no real Sub-picture Highlight visible. Jeff gives full details on doing this. Same for those who have seen a Button with a duo-tone thumbnail, that turns full-color, when the Button is navigated to. Wow, how did they do that, and why can't Adobe Encore do that? Well, what they saw was a dupe Menu, with a full-color thumbnail and no visible real Sub-picture Highlight.
    Jeff shows how to create what appears to be at least a 3-color Sub-picture Highlight. It's really just 3 regular 2-bit color Sub-picture Highlights, with Masking to create the illusion that he beat the DVD-specs. Neat! [Being from the USA, I also liked that he used the US flag, but he could have chosen the French "Tri-color," or any other flag, without artwork.]
    These are all just tricks, but if the user buys into the illusion, who's to know?
    Enjoy,
    Hunt
    PS - though many of the great, older posts were lost, when the forum changeover happened, I strongly suggest reading the posts here. You can bypass ones that do not offer you anything, but almost every possible illusion has been discussed at least one time, and likely many, with some different workflows offered by those, who replied. Great reading.

Maybe you are looking for

  • Open and Save Dialogs Slow to Open and Populate

    In all of my apps, the Open and Save dialogs have become very slow to open and populate since installing Snow Leopard, when the machine is connected to a Windows server. Disconnecting from the server solves the problem; reconnecting causes it to reap

  • Is there a way to rename a group of tracks being imported to Itunes?

    Usually, when I import audiobooks from CD to ITunes, I end up with a series of tracks named "Track 01" through "Track XX". I have ITunes set to search the internet for track names, but audiobook tracks aren't songs and seldom have names entered on-li

  • Batch Processing and Putting Two files together?

    Hello, I'm trying to find out if there is a way, in Photoshop, to automate placing a logo file and border from another file into a set of photos? Basically, I have a folder of, let's say, 4x6 images, and I have a file that has two layers, a thin tran

  • User exit for PGI via delivery (Vl02N)

    Hi Folks Can you suggest me appropriate user exit which can be used during PGI for delivery in Vl02N. This should get triggered when POST PGI tab is hit in VL02N. Via USer exit I want to change the GL account in the accounting document for PGI ( GL a

  • X-FI Fatality high pitched beeeeep

    Just a little note to bring back up the constant beep problem after playing BF242 for 0 mins. I know its been posted before on here many times but has anyone come to a solution to the problem as its still doing my head in!!