Dreamweaver CS4 automatically uses 3-digit hexadecimal shorthand for colors (e.g. #FFF instead of #FFFFFF for white). You need to use the 6-digit values instead.
Solution
Use a regular expression to find the 3-digit values and replace them with the equivalent 6-digit value. You can store a query in Dreamweaver to replace all shorthand hexadecimal values in a single find and replace operation. The regular expression can be used in JavaScript, PHP, or any other situation where regular expressions are supported.
You are a photographer, or your client is. You've got some wonderful photos that you want to show in a website, but you don't want anyone to steal them. How can you prevent them from being copied?
Solution
You can't. It's impossible. A number of so-called solutions abound on the web, but none of them works. Even if you use a technique that avoids the image being loaded into the browser cache, screen grabbing software can easily make a copy of any image. However, there are a number of techniques that help protect images.
I want alternate table rows to have a different background color. I know I can do it by adding a CSS class to every other row, but this means I need to change the code every time an new row is added to the table.
Solution
Use JavaScript or a dynamically-generated table to add a different background color to every other row. This recipe shows you how to do it with Spry, jQuery, or PHP. Alternate colors for table rows not only look more attractive, they increase the readability of tables filled with data.
Some events fire more often than others. Depending on what the designer is trying to achieve, this can be inefficient and may not have the desired effect at runtime. Another issue is the sequence in which events fire. A designer may have a requirement for several scripts to fire in a certain sequence. Having an understanding of how LC Designer and Acrobat fire events can help at design time.
Solution
I original had the idea of having a form that set out the pros and cons of each event and giving examples of script that could be used in each event. In the end, it has focused on the number of times that different events fire and the sequence. To view this form you will need Acrobat/Reader version 9 or above. This is because it contains script against the preOpen and postOpen events. Also it used setItems to populate the listbox.
There are a wide range of scripts that can be used to access menu items in Acrobat. However some of these are blocked for security reasons. There are a range of menu items that are still accessible; however the syntax is not always clear.
Solution
This PDF (XFA form) provides the script for the Acrobat menu items that are currently permitted. It also has XFA equivalents and Acrobat JavaScript equivalents, where these are available. The form is set up so that you can access the scripts by clicking the buttons. The scripts appear in a dialogue and can be copied directly into LiveCycle Designer.
What if you are creating an application that compile size matters and you want to use JSON strings to get data into your application. JSON stands for JavaScript object notation, it is a more condense data format then XML and is able to define different types of data not just Strings. You can use the Adobe Core Lib classes to parse this information but these classes add a little extra weight to your application and in some apps this isn't ok but there is another way.
Solution
Because JSON is just a subset of JavaScript objects ExternalInterface can just send these objects as Strings to JavaScript within your browser and the JavaScript interpreter will send an ActionScript Object back to you with the correct types. I have also noticed that this information is parsed faster and more reliably then the standard version but remember that this is only helps you with decoding. If you would like to create a JSON string from an Object you will have to use something else.
You want to print a PDF file directly from AIR without displaying it to the user and using your own custom button (not the default PDF control bar).
Solution
Open the PDF document you want to print in Adobe Acrobat Pro. Add the JavaScript code to your document and save it. Create an HTML page that contains a JavaScript function and embed the PDF document. In your Flash (or Flex) file add a button that prompts the user to print the document. Add the ActionScript 3.0 code that communicates with the HTML page. Publish your AIR file (making sure you include the HTML and PDF files). Test your AIR app.
The amount of data you need to encode into a barcode from your form can vary. How can you automatically increase the number of barcodes on your form to capture all of the data?
Solution
Dynamically increase the number of barcodes, according to the amount of data present.
I want alternate table rows to have a different background color. I know I can do it by adding a CSS class to every other row, but this means I need to change the code every time an new row is added to the table.
Solution
Use JavaScript or a dynamically-generated table to add a different background color to every other row. This recipe shows you how to do it with Spry, jQuery, or PHP. Alternate colors for table rows not only look more attractive, they increase the readability of tables filled with data.
This site is produced in partnership with O'Reilly.