Acrobat 9 Pro: Creating Multimedia Projects
Illustration by Neil Webb

Working with ActionScript FlashVars and Acrobat (Acrobat version detect)


From:

Acrobat 9 Pro: Creating Multimedia Projects

with Brian Wood

Video: Working with ActionScript FlashVars and Acrobat (Acrobat version detect)

If you are a Flash developer or even just work in Flash, and maybe you do a little bit of ActionScript coding, we can now take a SWF file that has been published from Flash, bring it into Acrobat, and have a bidirectional communication I guess you could call it. The ability for the SWF to talk to the PDF and the PDF to talk to the SWF, via ActionScript, or even for that matter JavaScript. We are going to focus on ActionScript. We can pass variables from the SWF to the PDF and the PDF to the SWF. So what we are going to do is we are going to insert a published SWF file that has some files connected to it, and let me just show you the little folder I have got here.
Expand all | Collapse all
  1. 5m 42s
    1. Welcome
      1m 8s
    2. Using the exercise files
      1m 8s
    3. Isn't a PDF just for reading?
      3m 26s
  2. 36m 15s
    1. Using links
      4m 35s
    2. Creating links
      4m 28s
    3. Editing links
      4m 22s
    4. Creating web links
      4m 9s
    5. Cross-document linking
      6m 21s
    6. Links and destinations
      6m 11s
    7. Creating link shortcuts
      6m 9s
  3. 38m 6s
    1. Adding buttons
      7m 50s
    2. Creating rollover buttons
      8m 8s
    3. Duplicating buttons
      5m 47s
    4. Using buttons to show and hide fields
      8m 43s
    5. Creating multiple action buttons
      2m 17s
    6. Button extras
      5m 21s
  4. 11m 50s
    1. Understanding multimedia and your audience
      4m 46s
    2. Understanding the difference between Acrobat Standard Pro and Pro Extended
      2m 27s
    3. Embedded vs. linked multimedia
      4m 37s
  5. 55m 13s
    1. Inserting Flash (SWF files)
      3m 33s
    2. Setting advanced options
      4m 51s
    3. Editing the play area
      2m 20s
    4. Inserting Flash content with resources
      5m 29s
    5. Working with ActionScript FlashVars and Acrobat (Acrobat version detect)
      6m 36s
    6. Working with existing chapter points
      9m 12s
    7. Adding chapter points when converting to FLV (Pro Extended only)
      3m 38s
    8. Converting to FLV (Pro Extended only)
      5m 39s
    9. Setting a page action to auto run multimedia
      4m 24s
    10. Adding video to Microsoft Office files
      5m 43s
    11. Commenting on video
      3m 48s
  6. 51m 28s
    1. Adding legacy multimedia
      7m 41s
    2. Setting the appearance (legacy media)
      4m 55s
    3. Setting playback settings
      8m 9s
    4. Adding alternate renditions (legacy media)
      5m 47s
    5. Linking to URL video
      6m 6s
    6. Controlling playback with buttons
      8m 25s
    7. Setting multimedia playback and multimedia trust preferences
      6m 5s
    8. Creating a PDF from drag and drop
      4m 20s
  7. 49m 37s
    1. Understanding audio formats
      4m 19s
    2. Inserting an audio file for Acrobat 9 playback
      6m 50s
    3. Inserting an audio file for Acrobat 8 and earlier playback
      6m 19s
    4. Setting the appearance of legacy sounds
      4m 24s
    5. Setting a page action for control
      10m 23s
    6. Controlling playback with buttons
      8m 17s
    7. Creating audio renditions
      6m 24s
    8. Understanding the difference between audio comments and multimedia audio
      2m 41s
  8. 22m 13s
    1. Understanding layers
      2m 13s
    2. Creating layers
      3m 28s
    3. Setting layer properties
      5m 9s
    4. Using button actions to show and hide layers
      3m 27s
    5. Using bookmarks to interact with layers
      4m 6s
    6. Importing a file as a layer
      3m 50s
  9. 44m 19s
    1. Understanding full-screen presentations
      2m 36s
    2. Setting initial view options
      4m 22s
    3. Setting full-screen preferences
      5m 50s
    4. About page actions
      2m 30s
    5. Creating a full-screen presentation using a page action
      4m 36s
    6. Adding a button to enter and exit full-screen mode
      6m 43s
    7. Setting transitions
      4m 48s
    8. Adding a document action to enter full-screen mode
      3m 16s
    9. Controlling full-screen mode using JavaScript
      9m 38s
  10. 1h 4m
    1. Introduction to JavaScript and Acrobat
      4m 2s
    2. Where does JavaScript go?
      5m 28s
    3. Creating a pop-up menu system
      10m 3s
    4. Manipulating PDF layers
      6m 3s
    5. Showing and hiding text fields
      8m 40s
    6. Spawning page templates
      11m 4s
    7. Popping an Alert window
      6m 14s
    8. Creating an Acrobat version detect pt. 1
      6m 21s
    9. Creating an Acrobat version detect pt. 2
      6m 18s
  11. 14s
    1. Goodbye
      14s

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now
please wait ...
Watch the Online Video Course Acrobat 9 Pro: Creating Multimedia Projects
6h 19m Intermediate Jul 21, 2009

Viewers: in countries Watching now:

Acrobat 9 Pro has the ability to integrate JavaScript, multimedia, and Flash within interactive PDFs. In Acrobat 9 Pro: Creating Multimedia Projects, Brian Wood teaches web developers, graphic designers, and anyone else how to use Adobe Acrobat 9 Pro. He shows how to create visually exciting PDF presentations, documents, and interface elements for distribution on the web, on CD/DVD, and via email. Brian explains the difference between embedded and linked media elements and shares several JavaScript examples that relate to all aspects of multimedia. Exercise files accompany the course.

Topics include:
  • Working with the new Flash CS4 video integration Embedding and linking to all types of multimedia Creating links, buttons, and other navigation systems Integrating layers and buttons for web page-like effects Adding sounds to complement embedded video action Using buttons and bookmarks to interact with layers
Subject:
Business
Software:
Acrobat
Author:
Brian Wood

Working with ActionScript FlashVars and Acrobat (Acrobat version detect)

If you are a Flash developer or even just work in Flash, and maybe you do a little bit of ActionScript coding, we can now take a SWF file that has been published from Flash, bring it into Acrobat, and have a bidirectional communication I guess you could call it. The ability for the SWF to talk to the PDF and the PDF to talk to the SWF, via ActionScript, or even for that matter JavaScript. We are going to focus on ActionScript. We can pass variables from the SWF to the PDF and the PDF to the SWF. So what we are going to do is we are going to insert a published SWF file that has some files connected to it, and let me just show you the little folder I have got here.

Let me open this thing up. And if you take a look, you are going to see that I have got kind of a simple SWF here that has the FLV playback component in it, and all it's going to do is play a video. That's all I wanted to do. Now the cool thing about the story is in the SWF when I created this file in Flash, I put an action on the first frame and I put a little bit of ActionScript code in there, which created two variables. So what this is ultimately going to do is it's going to make it where we are going to have an FLV up in the web server that I have already loaded up there, and we are going to make it so that if they are connected to the web, it will do that one.

It will actually play that one within the PDF file. It will stream it. And if they are not connected to the web, it will use this one right here called Chocolate. That's embedded in the file, and it's a relatively small file, 4MB, but anyway we'll put it in there. So we are going to insert the Flash file, the SWF file right now, and kind of get things set up. So we are going to use what's called FlashVars or FlashVars, however we want to pronounce it, and this allows us to use FlashVars field to add ActionScript variables to the file. So I'm going to come under Multimedia here with this PDF file opened, come to the Flash tool, and I'm going to double-click.

So it scales it, puts it in 100%. I am going to go find that file. So I'll click on Browse, and I can see it's called Multi version, it's a SWF file, we are not going to put an FLA in here. So that's the original file. So I'll click Open. Now we are going to go down and Show Advanced Options, click Show Advanced Options, and we have got some things we can do. We can make it, once you're activated, as soon as the page is opened, and that's what I really want to do here. So if you come to pages visible, how about that? And I wanted to stop playing when somebody gets off the page.

So the page is not visible. We can play it on the page or we can play it in a floating window. If you really want to do that, you can. It's kind of cool, puts in the box that floats out there. You can set a width and a height for that floating window if you want to. It won't pull it from the original file usually. One of the big things we want to do is I want to make it a transparent background. So if you insert let's say SWF files, you want to make sure that you select this, because wherever you see the stage itself in Flash, it's going to become transparent. Otherwise, you'll see like a white background, or if you set the background yourself.

So if I come to border width here, I can set the border as well. Let's say Thin maybe. And it will retrieve the poster from the media itself. We could also run with a poster from any kind of picture file within reason. So I'll click OK. Now there's a couple of things we need to setup here for this to work. I could have done it right then, but I didn't. So if you guys come up to the toolbars up there, right-click or Ctrl-click, we are going to come to Advanced Editing, we are going to edit this thing. Now if you have the Flash also selected, we could go out there and get to the Properties, but typically I come to the Select Object tool, come on out to this piece, and double-click on it to open up the Properties again.

If you take a look, you are going to see Resources. Now we could have done this when we placed it, I just wanted to get it on the page. The Resources are all the files necessary to run this SWF to get it to work. So we can add them independently or we can add an individual directory if we wanted to. I am going to click add and what we need to do is we need to insert the FLV and the Skin here. This is the skin for the player. I Ctrl-clicked on Windows or Command-clicked on Mac to get those. You can see there they are. They are going to be embedded eventually. I'll click Flash tab here, you are going to see that we have the ability to pass the context menu to the Flash Movie if you want.

Now by default, there is an Adobe or an Acrobat Context menu that shows up saying like, Disable Multimedia or something like that. If you have developed using ActionScript your own, or Context menu, you can pass it by selecting this. Now we are going to setup our Flash first. Like I said, I created two variables in the ActionScript and now we are going to tell them what they are. So we are passing them here. The variables themselves are online. This is the first one. So we are going to tell, if it's online, we are going to do a check here. I'm going to go up to the server, and typically when you do this yourself, if you decide to go with something like this, you are going to take a video and you are going to post it up there yourself.

So I'm going to put this FLV. Now this is the FLV playback component so it is going to require me to do FLV right now, which is fine. I'll also set my next variable here, and I'll say if it's offline, we are going to use this video that's embedded called Chocolate.flv. Now this may not make sense to you. You are going to see I have got two movies here that are different names. I'm going to prove a point here. I'm trying to say we have got a Cocoa up online, and we have got this one embedded. It should play the Cocoa version if I'm online, and if I'm offline it will play this one.

Typically what you do is you may have up online a high res version, maybe an H.264, awesome great looking video that you want to be able to stream into the PDF, and then this one offline may be kind of a lower res version that doesn't look as great, smaller file size, and it's embedded. So that's all I'm trying to get across here. So I'll click OK, I'm double-checking all its syntax. Everything I got out there. Looks good to me. Click OK, and we'll test it out. So if you come to the Hand tool. You are going to see we got the border and you got the played activated there.

Now I can still click on it, or I can go to the next page. To go to the next page by scrolling down, and then scroll back up, I'm using the scrollbar on the right, and there we go. It's playing the Cocoa video right now. Let's take a look. Hovering over, I can see this is part of the FLV playback component. This is the skin that came with it. So you can still play, you can pause, you can do different things with it. If I was offline right now, if I turned off my Internet, let's say it should play the internal video. Now if you played this thing, you may have gotten a warning the first time you played it saying it's going to play this thing, do you trust it as a trust? So you can take a look here and see that we can pass variables, and make it so that if you know ActionScript and you've got a lot of skill in that area, you can take a SWF file, bring it in, and do a lot of different types of interactivity between the PDF and the SWF file.

It's just a really simple example, and it's kind of a passive example if you will. So I would take a look in Adobe's website, you can see that there is an Acrobat 9 SDK up there and it's got lots of different things, to talk about related to ActionScript, and kind of how to get this to work, to do a lot of really cool things.

Find answers to the most frequently asked questions about Acrobat 9 Pro: Creating Multimedia Projects .


Expand all | Collapse all
please wait ...
Q: In the "Introduction to JavaScript and Acrobat" movie a URL is referred to at: http://livedocs.adobe.com/acrobat_sdk/9/...
I get error page when typing in this address. Do you have the correct URL?
A: The new link is:
http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/wwhelp/wwhimpl/js/html/wwhelp.htm?&accessible=true.
Q: In the Acrobat 9 Pro: Creating Multimedia Projects title, the author adds video controls by adding "skins" to the SWF videos in the PDF. It appears he does this by using the Resources tab in Flash preferences. When trying to duplicate the author’s method, however, the SWFs plays endlessly (loops), unless you right-click and choose Stop from the contextual menu. Is there a tutorial that specifically walks through getting the skins and using them to add the video controls?
A: Skins can be inserted if the file is converted to FLV when adding video into Acrobat Pro Extended. This is detailed in the Chapter 4 video "Converting to FLV.” Otherwise, the skin can be added in Flash before adding the video to Acrobat. Check out the "Working with Video" chapter in Flash CS5 Essential Training.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Acrobat 9 Pro: Creating Multimedia Projects.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.