How to Export Data from Crystal Reports

We usually have to export data from Crystal Reports, for a couple of reasons. One is, the program normally has to be there to read a Crystal file, so exporting allows others to read something. And unless the report is on a shared drive, it usually has to be emailed to the other parties.

Export data dialog

Luckily, the dialog box makes the process about as simple as possible. One can click File->Export->Export Report, or go directly to the Export button in the first toolbar. When the box appears, we have two main choices to make. One is the file format we’ll export data to. The other is what the program calls the destination. This can open the file directly in the receiving program, send into a folder, or just saving to a file. Usually we save to a disk file, as this is the most directly useful thing for business.

Export data PDF

There are three or four formats which seem to be the most frequent choices. When we export data to PDF format, it’s similar to printing, and anyone with Acrobat Reader can use it.

Export data Excel

Saving to Excel format is limited (to my knowledge) by the fact that it’s in the older, XLS format. So we can only throw in about 65,530 or so rows of data. For larger reports, this might be a problem, but one could export data in pieces and assemble them. And the formulas doing the calculating evaporate, but not the results.

Export data HTML

We use HTML format a little less, but it can be helpful when reports need to go on the internal website. The main thing to know here is the dialog box for saving is in the older style. It requires us to navigate for saving by opening and closing folders. And we have to allow for the file(s) saving in a folder at the location we choose. We can save the report as one HTML document, or one webpage per Crystal page, with or without navigation tools.

Export data Text  Export data TTX  Export data TXT

The format that seems to export data oddly is Tab Separated Text (TTX). Normally the extension should be TXT, as far as I know. So when Crystal creates the file (it’s plain text), I just change the extension and acknowledge the “unusable” message. The icon changes to the Notepad piece of paper, and it’s good to go. Seems to work fine. I couldn’t tell you which versions of the program have this oddity, but the cure is simple.

Again, the only major limitation all around is we don’t keep the formulas, only their results. So whatever calculations are giving us our answers won’t carry over. In most cases, according to what I’ve heard, this isn’t a problem. Since the results are usually more important than how they got there, the formulas (if correct) don’t have to be there. I understand some people have macros and code to export data with formulas. It would certainly be worth investigating.

How to Use Warp Type in Adobe Illustrator

Illustrator is capable of treating text as a graphic element much as anything we draw with any of the tools, so the ability to warp type shouldn’t come as a surprise. Type on a path is another feature in the same ballpark (check my previous post).

Warp type starting point

The basic starting point is the same. We use the Type tool, usually, to create the piece of text we need. We then have to tell the program to treat it as a graphic element rather than a text box per se. (This allows the Warp Type control to show.) We do this by switching to the Selection tool (black arrow) and clicking the text. We see the box selected overall, not just the text within it.

Warp type option

If we then look up at the Options panel, we have options specific to the text box. One of them will be the curved grid at right; this is the Warp Type button. It’ll say “Make Envelope”, and bring up a box called Warp Options, but it’s the right tool.

Warp type dialog box

In the dialog box, we have to select a style of warping, vertical or horizontal, the percentage of “bend” (how much to warp type), and the percentage of horizontal and vertical distortion. This is where one often has to pause and ask “How much of this, or that, should I apply?” Sometimes, the answer is given by whatever requirements were written up by the client or recipient. Or one can experiment and see what looks good aesthetically, if permitted.

Warp type result

There are a few guideline-type points to think about, though. 1) Don’t distort the text beyond readability. It defeats the purpose. 2) If you can, give some thought to the choice of font. This too can affect the readability, as fancier fonts with Warp Type running can look like tangled fishnet. 3) Most of the dialogs in the Creative Suite/Cloud have Preview checkboxes so we can play and see a live preview. Use them, by all means.

(This all works with type on a path, too. Whether it’s a good idea to do this depends on your artistic goals. But you can certainly give it a go.)

And although there is no way I know (except by creating actions) to repeat a Warp Type setup in the dialog box, you can write down any particularly good combinations for later. Or, as I said, create an action to record the details. Just remember NOT to record the selection of the text box—this way you can apply the action to any text box.

Use Type on a Path in Adobe Illustrator

The use of type on a path is an interesting cross between text and graphics, and allows text to be more than just a means of conveying information in Illustrator. But in order to use the feature correctly, one has to understand a couple of things about how it behaves.

First, we usually need to create the shape which we’ll use as a baseline, in the sense that typography uses the term—the line on which the text sits.

Type on a path

Then, we select the Type on a Path tool (in the same flyout as the regular Type tool). Position the cursor on the edge of the shape. When the “squiggle” that marks the hotspot of the cursor is on the line, we can click and type.

Once we click, we can also do most of the basic things we expect with text. We can change font, size, color, alignment, and so on.

Type on a path brackets

There are a couple of controls we need to know about, as well. They’re called brackets, and they control where the text is on the path. The two outer ones are the bounds of where the text can be; we can adjust them to show or hide the ends of the text. The middle one lets you slide the text along the path, left or right, till it gets where you want it. We usually use the Direct Selection tool to work with them. Grab carefully—watch for the cursor change to tell you when your cursor is on the control.

Type on a path options

We can also go to the Type menu > Type On A Path > Type On A Path Options command, and change how the text sits on the path. These are interesting, and can add a little pizzazz to text if you need it.

Type on a path flip

Dragging the bracket to the opposite side of the path will indeed flip the text “over”, another potentially useful trick.

One peculiarity, though. Sometimes, when we first click the path (especially if it’s closed), the insertion point can appear halfway round from where we click. So we drag the center bracket round to where we want the type on a path. (After all this time, I still don’t know why this is the case, but better to be aware.)

Many people tell me they find using guidelines helpful when precision placement of text is important. Dragging the path object to the right size, placing it carefully, and remembering it loses color when we add the text (we can click with the Direct Selection tool later to add it in again) are all things one should practice when working with type on a path.

Working with Image Size and Canvas Size in Photoshop

The Photoshop features called Image Size and Canvas Size can be a little confusing. The names are similar, and at first glance what they do will seem to be also. And both are on the Image menu. But the two controls do something quite different from each other, and understanding how can be helpful.

Once we open a sample document, we can try using each one. First, Image Size. This feature can change two main things—(a) the size, in height and width, of the printed image, and (b) its resolution, or level of detail in pixels per inch.

Image size box

Since it can affect the number of pixels, regardless, it affects the amount of information in the file, and therefore, the file size on disk. The key point is that when we use the Image Size dialog to change height and width, we are “stretching” or “squishing” the image as if it were printed on taffy. We are not adding more “canvas” around it (background) or trimming any off (cropping). Aside from the resolution, we are not changing the image itself.

Canvas size box

But the Canvas Size feature can. If we bring up this dialog, we are now either adding “blank” space around the image (if we increase the size) or cropping part of the image (decreasing). Think of unrolling new canvas from underneath, or cutting it away. We cannot change resolution with this feature, but this is not a problem.

Canvas size anchor

We can, however, determine where the new blank space goes, or where the crop will do its thing. The Anchor feature allows us to say if the expansion will start from top, bottom, side, corner, or center. And if we reduce the size, where it will “aim” toward.

Canvas size resized

So if we want to create a composite image, but not have pieces overlapping, Canvas Size offers us one option. If we need to resize an image to fit height and width, Image Size can come into play as well.

The Difference Between Double and Single Quotes in PHP

In PHP, the difference between using double or single quotes is quite large unlike other languages like JavaScript.  The main difference, that I believe is most important, is you can use variables inside of double quotes in wherein single quote statements you cannot.  For example, if I have a variable set like so:

$age = 22;

And I wanted to use it in an echo statement I could do this with single quotes:

echo ‘I am ‘ . $age . ‘ years old’;

That would work fine, it would print out to the page “I am 22 years old” just like expected.  There is nothing wrong with that except we have to use concatenation (adding strings together) by adding the periods.  The useful part about double quotes in PHP is you don’t have to use concatenation, you just insert the variable inside the string like so:

echo “I am $age years old”;

This would print out to the page “I am 22 years old” and it was a lot easier to type out and read without using the concatenation periods.  If you’d like to learn more, be sure to check out our web design/development trainings.  Have an amazing day!

 

How to Adjust Resolution in Adobe Photoshop

Resolution, in the graphics world, refers to detail. Usually, in a Photoshop document, it means the number of dots or pixels per inch. And this number tells you how detailed, sharp, or clear the image will be. Generally, the higher, the better. But there are a couple of points we need to know to use this to the fullest.

Dialog box resolution

Changing the resolution of an image is very simple. Having opened the image, we go to the Image menu, click Image Size, and change the number as needed. The number of pixels per inch is usually figured according to the purpose of the image.

Internet resolution

An image for use on the Internet will generally be at 72 pixels/inch, because most monitor hardware will consider that the “common” resolution. It’s been the lowest common denominator for many years, because 72-point type is one inch tall. So it’s convenient, regardless of the image’s height or width.

Print resolution

But most printing devices can go quite a bit higher without even breaking a sweat. So if you’re scanning an image for print, the minimum resolution you’d want is 300 pixels/inch. Turns out there’s a scientific reason for this number—it’s the limit of resolution for the normal human eye. At 300 per inch, a person can just barely see the individual dots, so it’s a good middle ground. Not too much detail, but about as much as we can use.

Archival resolution

Beyond this, we usually think of what are called “archival” images. They may or may not see print, but they mainly go for storage. Museums, for example, will scan images at a resolution of at least 1200 ppi to make sure they get every detail for posterity. The Vatican Museum has scans of Michelangelo’s correspondence at resolutions at least this high. (Good thing, too. The ink he used is eating the parchment.)

Resolution too low

The one thing we should NOT do is scan anything at LESS than about 72 ppi. That’s the minimum for a meaningful level of detail in any image. If we go lower, any kind of detail such as writing will often be too blurry to understand. And we don’t want to set the resolution of an image lower than that, because we can’t get detail back once we do.

One last thing. If you have the authority to set the resolution of the image, remember to strike a balance. Higher means more pixels, more detail, and a bigger file size needed to store it. Lower saves space, but loss of detail could be critical later. A little forethought on this could save time, stress, and upset.

How to run a function with a button click in JavaScript

In JavaScript, there are times when you need a block of code to just sit back, relax, and not run right when the page loads.  This is where JavaScript functions come in.  A function is a block of code that runs when we tell it to.  In this example, we will show how to run a function when a button is clicked.  The first thing we’ll want to do is create the button and give it an id using HTML:

<button id=”clickMe”>Run Function</button>

This will create on the page a button that says “Run Function” and has an id of “clickMe”.  That should do it for the HTML.  Now we need to write the code that will select the button and wait for it to be clicked:

<script>

var btn = document.getElementById(“clickMe”);

btn.addEventListener(“click”, alertMe);

function alertMe(){

alert(“The button has been clicked!”);

}

</script>

The first line of code here is using getElementById to go out and select the button and store it in the variable btn.

The next line is attaching the event listener to the button, which is stored in btn.  The event it’s listening for is a click event so when the button is clicked, it will run a function called “alertMe”

The third line is the actual function itself.  We create a function using the “function” keyword followed by the name of the function which is alertMe()

The next line is the code that runs when the function is called.  An alert is a pop up window that appears and this one will say “The button has been clicked!”

You can put all kinds of other things inside of the function besides the alert, this is just a very simple example.  But hey, at least you know how to fire off some code when a button is clicked now! (:  Here is what the code would look like when finished:

<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<title>Buttons and Functions!</title>
</head>
<body>
<button id=”clickMe”>Run Function</button>
<script>
var btn = document.getElementById(“clickMe”);
btn.addEventListener(“click”, alertMe);

function alertMe(){
alert(“The button has been clicked!”);
}
</script>
</body>
</html>

If you want to learn more, be sure to check out our web design/development courses.   Have an amazing day!

 

How to Create a Parameter Query in Access

The parameter query, while easy to set up, actually depends on a sort of quirk in the program, as we’ll see. But regardless, it’s a very powerful feature; it allows many variations on one question in a database. Ranges of dates, differences in spelling, and many others can fit a parameter query.

Parameter query prompts

A parameter query on a range of dates uses the “Between—And” keywords, and has the user enter a starting and ending date as indicated. (Any criteria of this sort go in the Criteria row in Query Design view.) The quirk is, when we want the program to ask the user for info, the prompt goes between square brackets, just as if it was a field name.

Parameter query box

This forces the parameter query to pause and say, “Huh? That’s not a field I know. Let me ask the user.” At which point it displays the prompt to the user, to inquire what the heck it is. The user answers with the appropriate data (the parameter), and voilà.

Parameter query plus like

But the real power of this feature comes from combining it with the wildcard. This is the “anything-you-like” character. Though this is not universally necessary, it makes the parameter query much more flexible. If a user can only remember part of a name, a couple of letters, or a not-very-specific parameter, it’s okay. We can then use the “like” keyword to help. This says “Find something like this.” Using the wildcard character (*) lets the user enter only what they have and ask anyway. Not as much help with dates, but many of the queries we run involve text. We can put the asterisk on either side, concatenated with the prompt (using “&”). Then there’s no problem having something start with, end with, or contain the letter(s).

Parameter query result

So if the user only knows a couple of letters in a company name, they can be entered for searching. If the result includes more than the one name, it isn’t a loss. Even if there are many results, better than not enough, or none, in most parameter query situations.

How to get user input in JavaScript

There are times in JavaScript when you’ll need to get the user’s input so you can perform some sort of calculation with it.  One of the most used methods to get user input is the command document.getElementById(“someId”).value.  To use this you would first need a textbox on the page which we create using HTML:

<input type=”text” id=”someId”>

Once the textbox is created with the id of “someId” we can use getElementById to capture the value like so:

document.getElementById(“someId”).value;

If we walk through this whole command we see that it starts at the whole document, then it narrows into an element (or tag) that has an id of “someId” and once it selects that it gets its value.  The value is whatever the user typed in.  The last thing is we would need to save that value in a variable or alert it out or do something else with it.  We can do that like so:

var someVar = document.getElementById(“someId”).value;
alert(someVar); // or
document.write(someVar);

Now that you can capture user input, you are able to take that and do all kinds of things with it like form validation, mathematical calculations, etc.  If you’d like to learn more be sure to check out our web design/development courses.  Have an amazing day!

 

Creating an Action Query in Microsoft Access

The action query in Access is a different thing from the normal query we create, called a “select” query. The latter simply selects data and shows the result. But an action query edits data, or even deletes it. And the key thing one needs to know about this is one cannot use Undo to reverse the effect. So though we can easily create action queries, we need to treat them carefully. Luckily, there is a way to test them first.

We can use a food database for our example. Let’s say we need to increase prices on soft cheese (Category 2) due to more touchy shipping conditions.

Select query  Run query

We create a regular (select) query to find the items in that category, and run it. This is how we test, prior to making it an action query. We see if it pulls up the right data first.

Action query

The next step is to return to Design view and go to the ribbon, specifically to the Query Tools Design tab and the Query Type group. Initially, a query defaults to being a Select query. We click the button for what we want now, in this case an (Update) action query.

Action query formula

Then we go into the query grid, click the proper cell in the Update To row, and write the formula to take the action. In this case, [UnitPrice] (the field name) *1.05 (up by five percent), in the UnitPrice column. It’s even possible to make this a variable, or parameter query, but the basic technique is the same.

Action query warning

But the most important item by far is the warning we get next. We’re told the action query can’t be reversed with Undo. And it does NOT say the query will then do what we told it. Nor do we get a “mission accomplished” message. The query simply runs. And changes data.

Action query result

This means we need to understand that an action query assumes we know it will do this. Therefore if someone doesn’t know, and runs it again, the query will apply the same change again. And again. As long as we are aware, it’s not a problem. But it is a caution we must keep in mind.

How To Use The Ternary Operator in JavaScript

In JavaScript, there is a thing called the ternary operator.  It’s a fancy term for a shorthand way to write an if statement.  To compare and contrast let’s take a look at the long way of creating an if statement:

if(x==1){

alert(“There is ” + x + ” apple”);

}else{

alert(“There are ” + x + ” apples”);

}

This example is checking the value of x and if it’s 1 it will alert “There is 1 apple”.  If it’s not 1, it will alert, “There are 3 apples” or whatever the number is that was put in there.  Well, there’s a shorter, easier way to handle this using the ternary operator.  This is how the ternary operator is set up:

var tern = condition ? do this if true : do this if false;

There is a variable set up and its set equal to the ternary operator.  The first part is the condition, then a question mark, then what will happen if the condition is true, then a colon separating what will happen if it’s false.  So we could set up our example like so:

var tern = x==1 ? “There is ” + x + ” apple” : “There are ” + x + ” apples”;
alert(tern);

If x is one it will set tern equal to “There is 1 apple” and alert that.  If it’s not 1 then it will set to tern equal to “There are however many apples” and alert that.  Pretty useful I must say.  If you’d like to learn more be sure to check out our web design/development tutorials.  Have an amazing day!

How to Create a Subquery in Microsoft Access

Just as there can be subforms and subreports within an Access form or report, there can be a subquery within a query. As the term implies, a “query within a query” allows the main query to be more specific, or complex. It sometimes requires a little bit of Structured Query Language, or SQL. But this is not a problem. Access is a “shell” over SQL as Windows was a shell over DOS, and the two get along fine.

Start subquery

A typical example would be setting up a subquery based on text information, to allow more flexibility with the use of number fields in a database. After opening the DB, we bring up the query window—better to do this in Design view—and add our basic query info.

Subquery zoom box

We can then either switch to SQL view, which some SQL users prefer, or right-click in the appropriate column and row. We then use the Zoom command to write the subquery.

Here we want to ask which products are equal to or less in price than Colby cheese. We want to base the question, though, on the name of the product, NOT the price itself. This is the key.

SQL code

So in the UnitPrice column of the query (through the Zoom box), we tell the subquery to select (and show) the products from the table (of Products) where unit prices are less than or equal to that of (the product name) Colby cheese. (Note the SQL keywords.) What usually causes a little confusion is that the “less than or equal to” operator comes before anything else. But the nature of comparisons in Access, as well as in SQL, often requires this. And since the comparison is numerical for all that we’re writing a “verbal” formula here, it comes with the territory. Once we know about it, it’s pretty straightforward.

Result

One point not everyone knows, though. If something is edited in the query results, we’re editing the actual data, not a copy. So a query (along with a subquery) can be used to find and correct potentially erroneous or out-of-date info. (One techno-term I’ve heard is “reflexive correction”.)

How to create a JavaScript Object

In JavaScript, there is a thing called an object.  It’s something that can contain a value that is equal to something else.  Those are called key/value pairs.  There’s a key that is equal to some value.  It’s a way that you can have a variable equal to many different items that can be used as functions, values, etc.  It gives the programmer a lot of flexibility on how they can get their job done.  The most simple way in JavaScript to create an object is like this:

var jsObj = {};

We just created an empty object there that could be filled in later.  Let’s continue with that and put some key/values in there:

var jsObj = {

firstName: “Dave”,

lastName: “Kidd

}

Here I created an object that has two keys: firstName and lastName.  Those keys have the values of Dave for firstName and Kidd for lastName.  To access those values I can use dot notation or a square bracket method.  Here is the dot notation method:

jsObj.firstName

jsObj.lastName

If alerted to the page, that would return Dave and then Kidd.  The other way you can access these key’s value is using the square bracket notation like so:

jsObj[“firstName”]

jsObjp[“lastName”]

That does the same thing as the dot notation, they are just two different ways to extract the values from the keys in objects.

Objects come from all over.  You can create them yourself as we did above, and there are a lot of built-in objects in JavaScript as well.  An example is the Math object which allows you to do things like generating a random number between 0 and 1 with Math.random().  Or the Date object that allows you to pull the time/day/month from the user’s computer.  Overall, objects are a very important aspect of any programming language.  If you’d like to learn more be sure to check out our web design/development trainings.  Have an amazing day!

How to Indicate Blank Results in Crystal Reports

When we print a report in any database-connected situation, we sometimes get blank results, i.e. nothing to report. But we certainly don’t want to waste paper on such a thing. So how can we let a user know about it without sending more than one page (at most) to a printer? If you routinely run reports that can come up blank, this might be important.

Some programs can show an alert message to this effect: “No results match your criteria.” And though Crystal Reports has what it calls Report Alerts available, I haven’t yet found a direct way to pop up an alert for blank results. But I did manage to dig up at least one way to reduce the waste.

blank results message

We can start with any report, and add a second report header (for example) to it. We insert a message such as “No records found to match criteria” in a text box there; making it big red letters or something is helpful.

The key is to use the Section Expert, and suppress this section UNLESS the report shows blank results.

section expert  formula

We go to the Expert, click the X2 button next to Suppress (No Drill-Down), and enter a formula like this:

IF COUNT({Orders.OrderID}) < 1 THEN false ELSE true

where the field can be anything in the Details section of the report. If no records show, the Details section will have nothing, and the condition will kick into operation. The user will then know there’s nothing.

If we want to be a bit more thorough, we can also conditionally suppress the other sections the other way round:

IF COUNT({Orders.OrderID}) < 1 THEN true ELSE false

so when the “blank results” message shows up, nothing else will. Except maybe the date and time in an unsuppressed section, or whatever else would be helpful.

blank results

I plan to keep looking for a way to have a Report Alert do this, as it would be a rather more “correct” solution. But the main point is to alert the user of blank results, and the technique I describe here works.

Substr vs Substring in JavaScript

JavaScript has some slick ways of dealing with strings (words, sentences, etc.)  There are a couple of methods in JavaScript called substr() and substring() that do similar but very different things.  Both are able to extract certain parts of a word or sentence to be used or validated.  The difference between them is substr gives a position and how many characters to extract, where substring gives a range of what characters to access.  For example, if we had this:

var str = “SkillForge”;
alert(str.substr(5,3));

This would return “For” because the 5  means start extracting from the 6th character, not the 5th.  Substr and substring start counting at 0 (it’s a JavaScript thing) so when we have 5 in there it actually means the 6th character which is the F in Forge.  Then the 3 tells us to extract three characters from the starting point that was given so that gives us “For”.  If I were to take out the 3 and just have this:

var str = “SkillForge”;
alert(str.substr(5));

It would give us “Forge” because it would start at the 6th letter (5th position) and extract everything until the end of the string.

Now that brings us to substring() which needs a start and end point where substr() just needs a start and how many characters to extract.  So if we had this:

var str = “SkillForge”;
alert(str.substring(2,5));

This would return “ill” from “Skill”.  The 2 tells us where to begin which is the letter “i” and then the 5 tells us how far to go into the string, not how many characters, the ending point.  With substring the end character is NOT included.  So i is the beginning and F is the end and we don’t include that so that ends up giving us “ill”.

Substr and substring are useful with form validation and any other times when we need to take a look at what the user is typing in.  If you want to learn more be sure to check out our web design/development courses.  Have an amazing day!

 

 

Using Fields in Text Objects in Crystal Reports

Fields, in Crystal Reports, are the way we bring data from a source into a report. Sometimes, we need to combine the data with text even more directly than placing them side by side.

Data source

The technique we can use is similar to creating a mail merge with fields in a couple of other programs. First, we pull up the basic data of a report. Choose the data source and table(s), deal with links between them if necessary, and OK out of the Database Expert.

Text object for fields

Next, create the text object. One thing to be careful of is making the text object large enough to accommodate the “sizes” of the data in the fields. For addresses, it’s usually not a problem, but because descriptions and bios can be lengthy, previewing the data can help. (Right-click the fields in Design view and selecting Browse Field Data.)

When we create the text within the object, another thing to be careful about is proper punctuation and spacing. Just as in word processing, lack of attention to this can make the report look shabby and unprofessional.

Fields placed

Dragging the fields into the text object is not hard at all; it simply requires a little practice to make sure we let go the mouse button at just the right spot. Make sure of where your pointer is. If you miss, just undo or delete the field and try again.

Result

Don’t be surprised if you need to go back and forth between Design and Preview a few times to do some fine-tuning of the fields/text object situation. This is quite normal. In addition, remember that the fields within the text object(s) can and should be formatted to match the text around them. (Selecting by dragging across them, or double-clicking them, will do it.) Otherwise, again, the final result won’t be professional-looking. Mismatches are visually inconsistent, and can actually make the document harder to read.

 

How to Loop Through an Array in JavaScript

Video version of this post:

In JavaScript, there’s a helpful way to access every item that’s in an Array and it’s called a for in loop.  It has the functionality, by default to go through and only run however many times there are items in the array.  To take a look at this we can set up an array like so:

var ninjaTurtles = [“Leo”, “Ralph”, “Don”, “Mikey”];

Now we could use a for loop and go through it like so:

for(i=0;i<ninjaTurtles.length;i++){
document.write(ninjaTurtles[i]+”<br>”);
}

This works and it would print out all their names to the page, but this way requires that we use the length property, that we set up a beginning and end value and then have to use i++ to make sure it counts correctly.  There’s just a lot to it.  Well, there’s a simpler, more concise way of doing it and that is using the for in loop.  Here is what it would look like:

for(i in ninjaTurtles){
document.write(ninjaTurtles[i]+”<br>”);
}

As you can see, the loop is a lot simpler and easier to read.  Instead of having three parts you only have one simple statement.  This loop inherently knows how many times to run.  It will run one time for each item that is contained in the array.  You don’t have to specifically tell it a number of times to loop.  Because of that, there is also no need to tell it when to end, where to start, or what to do each time the loop completes.  It’s just easier to read and write.

The variable i works the same way as it did in the previous example, it will contain the index value or position of each item in the array.  The first time it runs, i will be equal to 0.  The next time i will be 1 and so on.  For in loops are great and it makes coding loops a little more simple which I’m sure we all appreciate.  If you want to learn more be sure to check out our web design/development courses.  Have an amazing day!

 

How to Create an Action in Adobe Photoshop

An Action is the Photoshop equivalent of a macro in programs like Word and Access. It allows consistent repetition of a sequence of steps. So it’s easier to do the same thing in different files, if one wants. As usual, the thing which helps most is rehearsal—practice a little to avoid frustration when you record the real thing.

(I’ll apply a layer effect here, the Drop Shadow, for demonstration.)

Record action

After opening your file and setting up whatever elements we want to affect, we bring up the Actions panel and click the New Action button.

Action dialog

We enter a name, a keyboard shortcut if desired, and a color (optional but sometimes helpful). When we OK out of that box, we record any mouse clicks or keystrokes from there on.

Action steps

So my double-click of the text layer, making various adjustments to the Drop Shadow after activating, and subsequent OK are all written down as performed. The recorder waits till I OK out to jot down the final numbers. When finished, I click the Stop Recording button (left of Record), and the action is ready.

Use action

To apply the same attributes to another item (not necessarily text), I select the layer in question, click the action, and hit the Play button at the bottom of the Actions panel. About the only hard rule on using layer-based actions like this is, they can’t be applied to a Background layer. But that’s a particular of the action I’m recording. A non-layer-specific action can work pretty much anywhere in a file.

One also wants to remember to select or otherwise tell the action what it’s going to work on.

The not-immediately-obvious advantages are:

Action changes

First, in the Actions panel, any step which involves a dialog box has a clickable icon to make the action bring the box(es) up during the run, to allow user changes. Which means they can be flexible.

Action folders

Second, actions can go in folders, and we can save them as separate documents. They can then be opened in other files, or sent to other PShop users, or kept as backups. Portability!

And third, though it’s not a common use for actions, they can apply company colors or fonts to a document. Which means actions can be helpful in maintaining product branding standards, if needed.

JQuery Toggle Drop Down Effect

jQuery is a pretty amazing JavaScript library.  It allows you to do things with JavaScript that were, back in the day, pretty tough to pull off.  Today I want to show you how to do a simple toggle drop down effect using jQuery.  The first thing you’ll want to do is create a basic HTML page like so:

<!DOCTYPE html>
<html>
<head>
<title>jQuery Toggle Drop Down</title>
<meta charset=”utf-8″>
</head>
<body>
<p>
<span id=”s1″>
Click to slide panel up and down
</span>
</p>
<div id=”d1″>
This part slides up and down
</div>
</body>
</html>

This sets up a span and div tag that will use their ids to receive the user’s click and then respond to it.  Next thing we want to do is add the styling that will allow us to see this in action.  So add a style tag and that style block inside the head tag:

<style>
#d1, #s1 {
padding: 5px;
text-align: center;
background-color: #e5eecc;
border: solid 1px #c3c3c3;
}
#d1 {
margin: 10px;
padding: 25px;
width: 150px;
height: 150px;
box-shadow:5px 5px 10px #ccc;
}
</style>

Most of this is aesthetic stuff.  It just gives the span and div tags dimensions, background colors, aligns the text to the center, gives a border, and things of that nature.  Then to the main part of this tutorial.  Add this jQuery right under the closing style tag:

<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js”></script>
<script>
$(document).ready(function(){
$(“#s1”).click(function(){
$(“#d1”).slideToggle(“slow”);
});
});
</script>

The first line imports the jQuery library so you can use it.

The document ready statement tells the code contained in the following function to run after the whole page has loaded

The next line says when the tag with the id of s1 is clicked it will run the following function

The function tells the tag with the id of d1 to do a slideToggle() method.  This method is a built-in jQuery command that makes the div slide up and down revealing and hiding its contents.  All of that is just built into the jQuery language, you don’t have to manually code the animation.  When all is said and done, the whole project should look like this:

<!DOCTYPE html>
<html>
<head>
<title>jQuery Toggle Drop Down</title>
<meta charset=”utf-8″>
<style>
#d1, #s1 {
padding: 5px;
text-align: center;
background-color: #e5eecc;
border: solid 1px #c3c3c3;
}
#d1 {
margin: 10px;
padding: 25px;
width: 150px;
height: 150px;
box-shadow:5px 5px 10px #ccc;
}
</style>
<script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js”></script>
<script>
$(document).ready(function(){
$(“#s1”).click(function(){
$(“#d1”).slideToggle(“slow”);
});
});
</script>
</head>
<body>
<p>
<span id=”s1″>
Click to slide panel up and down
</span>
</p>
<div id=”d1″>
This part slides up and down
</div>
</body>
</html>

And there you have it, a cool way to show and hide content on a webpage.  If you’d like to learn more be sure to check out all of our web design/development training courses.  Have an amazing day!

How to Use Quick Mask Mode in Photoshop

Of all the “beyond-the-basics” tools in Photoshop, the Quick Mask feature is probably one of the most nitpicky to understand. But it can provide the user with a fairly easy method of doing something complex, namely, making selections. So it’s worth the time.

Selection

It’s normally easiest to start by making a partial selection of the area. Using a conventional method such as clicking with the Magic Wand will work fine. Then, going over to the Tools panel/Toolbox, we simply click the button near the bottom for Quick Mask mode.

Quick Mask button

Now, the trick here is knowing what Quick Mask mode does, and how. It turns the selection into a mask—that is, a colored area which tells us what parts we’ve selected and which we haven’t. The colored part, which is red by default, is NOT selected. Anything not covered by the red overlay IS selected. And the mask (for non-selected) is partly transparent so we can edit the selection and see what we’re doing.

Quick Mask brush

The next point is how to edit the mask. Once we’re in QM mode, we switch to the Brush tool. The brush should have a 100% hardness, and be about half the size of the areas we’re selecting (give or take).

Paint in QM

The critical thing now is which paint color we use. We should set the colors to default (black/white), and remember that the FOREGROUND color is the one the tool is looking at. If we paint with black, we MASK (or DE-select). If we paint with white (we can use the Switch Foreground/Background button), we UNMASK (or SELECT). A quick way to remember which is which would be “Black Blocks” (i.e. masks or de-selects).

Quick Mask off

When we’ve made the edits we want, we go back to the Tools panel, click the Quick Mask mode button again, and return to Standard mode. We again see the selection marquee, and can proceed from there.

The main question most people ask, if they know the regular selection tools, is Why mess with QM mode? The main answer is that selection tools can be a little fickle. When we click with the Magic Wand, especially, the Tolerance can affect what we select. Quick Mask mode and the painting tools are a little slower, but more precise. Especially if we zoom in to work.

How to use JavaScript Regular Expressions

Video of regular expressions with phone numbers:

This tutorial is going to look at a JavaScript regular expression example using zip codes and break down all the pieces.  The problem I’ve found with regular expressions is they aren’t something you can just look at and understand right away.  They use their own syntax that isn’t easy to decipher so that is what makes them hard to understand.

Let’s take a look at an example of one so they won’t be as intimidating.  Let’s say we want to use a regular expression to make sure that a zip code is typed correctly.  We will check for the regular zip code of 5 digits and also the format where it could be 5 digits followed by a dash or space and then followed by 4 more numbers.  The first thing we need to do is set up a variable that holds the string we are evaluating:

var zip = “78998”;

Next, we will set up the pattern that it compare against and save that into a variable as well:

var pattern = /^\d{5}(-?\s?\d{4})?$/;

This looks crazy right?  Well, if we break it down piece by piece, it’s really not too bad.  So let’s do just that:

  1.  The first part of the patter is a / and that means the pattern is beginning.  You need to define where the pattern starts and ends.  You do that with slashes like so:  / pattern /
  2. The ^ means it has to start with whatever follows in the pattern.  When combined with a $, which you see at the end of the pattern, that sets up the number of items that can be in the pattern.  For example, if I had the pattern of /^the$/  that would only match the word “the” and nothing else.  It has to be three letters and those three letters have to be t, h, e spelling out “the”.
  3. The next part \d{5} means 5 digits.  The \d means a number and the {5} means five of them in a row.  So ^\d{5} means the zip code must start with five numbers.
  4. The next part (-?\s?\d{4})?  is the most complex of the group.  The parenthesis at the beginning and end groups all of these together and the ? mark at the end means the whole group is optional, they don’t have to appear in the zip code for a match.  Inside the parenthesis, we have a -? which means the dash individually is optional,  \s? means the space is optional as well, and \d{4} means the space or dash would be followed by four more digits.  And the ? at the end means the whole group as whole isn’t required either.
  5. The last part is the $ sign which works with the ^ to say this zip code has to be 5 digits total or 9 digits total with an optional dash and/or space.  No more, no less.

Once the pattern is set up, all we need to do is apply that pattern to the zip code variable and see if it passes the test or not.  We can use the “test” method to do that like so:

alert(pattern.test(zip));

If it passes the comparison, then this would alert “true” and if it doesn’t pass the test it would alert “false”.  The final code would look something like this:

<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<title>Zip Code Regular Expression</title>
</head>
<body>
<script>
var zip = “78998”;
var pattern = /^\d{5}(-?\s?\d{4})?$/;
alert(pattern.test(zip));
</script>
</body>
</html>

Try changing the value of zip to valid and invalid zip codes and see if it works.  Hopefully, this helps demystify regular expressions a little bit.  There is a lot more to them which we go over in our web development courses.  Feel free to check them out if you want to learn more.  Have an amazing day!

Using the Gradients in Photoshop—Additional Info

In an earlier post, I went through the basics of creating gradients in Photoshop. In this one, I want to mention a couple more details which might be helpful in their use.

There are five patterns, or appearances, which gradients can follow, shown to the right of the Gradient Editor in the Options panel. The one we use most, Linear, makes the color pattern appear as bars, or bands, in the selected area. But the others are potentially quite useful, and not just for decor. One selects the gradient and pattern, and drags from point A to point B, just as with Linear.

Radial gradients

The Radial gradient is a “sunburst”, the leftmost color in the center and moving outward in rings. This has been used with several real-life concepts, e.g. distances from the center of a city for travel purposes.

Angle gradients

The Angle gradient uses the direction of the drag to create a “wheel” effect. The starting color is on one side of the drag line, shading around in a circle to the ending color on the other side of the same line. This can create an object-lit-on-one-side effect by having black and white as the starting and ending colors. It’s often employed as sheer decoration. Of all the gradients, some people consider it the prettiest.

Reflected gradients

The Reflected gradient can do something interesting: Using metallic colors with it creates the illusion of specular, or pinpoint, highlights on metal. The “reflected” part indicates that the drag start point becomes a “mirror”. It becomes two “reversed” gradients, in bands centering on the start of the drag, a kind of “double linear” gradient. (One must therefore allow about twice the width of the drag for full visibility.)

Diamond gradients

The Diamond gradient makes the direction of the drag become one of the four points of a diamond version of the Radial gradient. Distance of drag works similarly as Linear. The start and end of the drag mark the extent of the color, and continue the last color out as far as possible.

Reversed gradients

One other element which occasionally comes into play is the Reverse checkbox in the Options. It reverses the direction of the gradients—start color and end color will flip around.

And don’t forget there’s an Opacity control in the Options, too.

How to autoplay a video using HTML 5 in Chrome

Chrome is a great browser but sometimes it has a lot of security features that end up conflicting with your code and what you’re trying to do.  For example, they added a feature that won’t play a video on a website if the sound is enabled.  It will block it because it doesn’t want the user hearing an unwanted video.  Using the HTML5 video tag, if I were to add a video to a page that has the controls visible, autoplays, and loops the code would look like this:

<video controls autoplay loop>
<source src=”movie.mp4″ type=”video/mp4″>
</video>

The issue with this is Chrome would not play the video because it hasn’t been muted.  The sound would start to play and Chrome doesn’t want that.  So the solution is pretty simple, you have to mute the video and then, only then, will Chrome play it normally when the page loads.  To mute the video add a “muted” attribute like so:

<video controls autoplay loop muted>
<source src=”movie.mp4″ type=”video/mp4″>
</video>

Now Chrome’s security feature will be fulfilled and the video should play as normal and if the user wants to hear the video, they’ll have to unmute it.  If you’d like to learn more, be sure to check out our web design/development courses.  Have a great day!

How to apply CSS to XML

Sometimes there will be times when you’ll need to take a body of XML information and apply CSS styles to it.  Luckily, it’s not too hard to do.  Let’s say you have an XML document that looks like this (the content about the movie is not accurate):

<?xml version=”1.0″ encoding=”utf-8″ standalone=”yes”?>
<movie>
<title>Monty Python and the Holy Grail</title>
<rating>PG-13</rating>
<reviews>
<rotten>100%</rotten>
<metacritic>100%</metacritic>
</reviews>
<director compensation=”$100,000,000″>Some really funny guy</director>
<boxoffice>$1,000,000,000,000</boxoffice>
</movie>

If I wanted to style the title, rating, director, and the other tags I would need to apply CSS to this file.  To do that you would need this line of code:

<?xml-stylesheet type=”text/css” href=”somecss.css”?>

You would put this under the first line of the XML making it look like this:

<?xml version=”1.0″ encoding=”utf-8″ standalone=”yes”?>
<?xml-stylesheet type=”text/css” href=”somecss.css”?>
<movie>
<title>Monty Python and the Holy Grail</title>
<rating>PG-13</rating>
<reviews>
<rotten>100%</rotten>
<metacritic>100%</metacritic>
</reviews>
<director compensation=”$100,000,000″>Some really funny guy</director>
<boxoffice>$1,000,000,000,000</boxoffice>
</movie>

This is saying, use and apply the CSS file called somecss.css to the XML page.  With the way this code is written, you’ll need to make sure that the CSS file is in the exact same spot as your XML file.  Once you’ve done this, the two files are connected and you can test to make sure it works by putting some styles in the somecss.css file like this:

title{
color:red;
font-size:22px;
text-decoration:underline;
}

If you see the content in the title tags change, you did it right.  If you’d like to learn more be sure to check out our web design/development courses.  Have an amazing day!

How to Create an Adobe Photoshop Gradient

Setting up a Photoshop gradient works a little differently from its cousin, Illustrator. The concept is the same, but the tool involved, and how we create and fine-tune a gradient, changes.

Photoshop gradient options

The first thing to do is select the Gradient tool in the Tools panel/Toolbox. Looking up at the Options panel, we find the dropdown with the choice of gradients on the left. Usually there are a dozen to sixteen presets; clicking one will select it. But if we want to create one, we can click the gradient already visible to bring up the Gradient Editor.

Photoshop gradient editor

The next thing we frequently do is make changes to whichever gradient we see. The house shapes under the horizontal strip (the gradient ramp) show what colors are in the gradient, and we can add more by clicking where we want them. We can also move them left and right as needed. A couple of dozen seems to be the practical limit. Double-clicking any of these (color stops) brings up the color picker, which lets us change the color as we like. The diamond shapes between the color stops tell us where the halfway point is for any two colors, and can be moved as well.

The upside-down house shapes above the Photoshop gradient ramp (no, they’re not from Australia!) are transparency stops. One can therefore make parts of the gradient fade out as much as one likes. Clicking once on either a color stop or a transparency stop makes its “roof” black. Then it’s selected and allows the controls at the bottom of the box to modify it. Even clicking the diamond shapes allows us to use the percentage controls at bottom to position them.

Photoshop gradient name

Finally, when we’ve got the arrangement we like, we can type a name in the space at center, click New, and go ahead and use it. From here, it’s straightforward—select the area we want to fill with the gradient, click the Photoshop Gradient tool, and drag in the space. Length of drag tells the program how short or long the color transition should be. Direction of the drag gives the angle. And voilà. 😊

How to fade in content using HTML, CSS, and JavaScript

Sometimes we want our content to make a cool entrance on a webpage.  Luckily, using CSS and HTML, we can do just that by easily fading something onto the page.  First thing we’ll need to do is create a HTML page like so:

<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<title>Select Tag</title
</head>
<body>
<div id=”fademe”>Fade me in!</div>
</body>
</html>

This is your typical HTML page that has a div with an id of fademe.  We will be fading the div in later with the text “Fade me in!”.  The first thing we’ll need to do is create the CSS inside the head tag that will make the text invisible so we can start from not seeing it to seeing it.  Add the following inside the head tag:

<style>
#fademe{
opacity:0;
transition:2s;
}
</style>

This selects the div using the #fademe selector and makes it invisible with the opacity set to 0.  The transition property says if any of the properties that have already been set are changed, it will animate that change for 2 seconds if it can. Well, we need to change the opacity from 0 to 1 and we’ll need to use JavaScript to do that.  We will use window.load to run the code after the page has loaded.  Right before the closing body tag in the HTML, we will put this:

<script>
window.onload = function(){
document.getElementById(“fademe”).style.opacity = 1;
}
</script>

This says when the window loads it will run a function.  A function is a group of code that runs when we tell it to.  When the function runs it will select the element (or tag) with the ID of fademe (the div) and then change the opacity style to 1.  When all is said and done the completed project will look like this:

<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<title>Select Tag</title>
<style>
#fademe{
opacity:0;
transition:2s;
}
</style>
</head>
<body>
<div id=”fademe”>Fade me in!</div>
<script>
window.onload = function(){
document.getElementById(“fademe”).style.opacity = 1;
}
</script>
</body>
</html>

When this is run, you will see the div, with the text in it, fade onto the page in 2 seconds.  If you want to learn more be sure to check out our web design/development courses.  Have an amazing day!

 

Create unselectable instructions in a HTML select drop down menu

Today we are talking about how to create unselectable instructions in a HTML select drop down menu.  In HTML, when you create a drop down menu using the <select> tag, there will be times when you’ll want to give the user instructions inside the menu itself but not allow them to select the instruction option.  For example let’s say we want to give the user the ability to select what shipping they want for an item they are ordering.  Our select tag would look something like this:

<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<title>Select Tag</title>
</head>
<body>
<select>
<option>USPS</option>
<option>UPS</option>
<option>FedEx</option>
</select>
</body>
</html>

This works fine but when the dropdown menu shows up in the browser it looks like this:

dropdown HTML

There are no instructions so the user may not know what the purpose of these options is.  I don’t want to put the instructions as text on the page since I don’t like how that looks, so I will add an option tag that will have the instructions in it with a couple of attributes that will accomplish what I want.  The select tag options would end up looking like this:

<select>
<option disabled selected hidden>Choose Shipping</option>
<option>USPS</option>
<option>UPS</option>
<option>FedEx</option>
</select>

You can see that I added another option tag with the disabled, selected, and hidden attributes which transform the dropdown to look like this:

dropdown HTML select tag

The instructions “Choose Shipping” is there but the attributes change how it functions.  The disabled attribute makes it so the user can’t select it, selected makes the browser select it by default when the page loads, and hidden makes it so it doesn’t show up with the other options in the drop-down menu.  This helps for a cleaner design in the HTML forms and allows everything that is related to the drop down select menu to be bundled together.  If you want to learn more, check out our web design/development courses.  Have an amazing day!

 

 

Using the Section Break in Microsoft Word

When putting together a complex document in Word, a section break can help us put together documents such as a book or manual, where one sometimes has to create multiple headers and footers, or allow for single columns, then multiple, then single again. A section break is like a fence between two farms—it tells the user “there’s a border and a change here”.

Section break command

Inserting a section break is very easy. Click at the end of whichever piece of text is the “previous” layout, arrangement, or whatever, then go to the Page Layout tab, Page Setup group, and click Breaks. There, we have a choice of four types of section break. The most commonly used one is Continuous, meaning there’ll be no visible break except what we decide on—the new section will start on the same page.

Columns command  Section break columns result

Once we insert the break, we can do several things after it. A frequent use is to change the number of columns in the new section. We click anywhere after the section break, go again to the Page Layout tab, Page Setup group, and click Columns. If we want a default number, say two, we just click on it. If we want something a little more customized, we click More Columns at the bottom of the menu, and decide on width, spacing, line between, and so on. Then click OK to get out, and there we are.

(The next bit here will refer to continuous section breaks, the touchiest kind, first.)

Show Hide Characters   Show section break

When it comes to headers and footers, we have to be a little more careful where we click once the section breaks are in place, but we can turn on the Show/Hide feature in the Home tab, Paragraph group to help. (I always do—makes life easy. Already did here, so you folks can see what I’m doing.)

Section break header footer

We then simply insert section breaks where needed. If we don’t do this, the program can’t do the rest. Once the breaks are in place, whichever page FOLLOWS the break(s) will show the next section number. So if one inserts a continuous section break on page 2, the next section header/footer will start on page 3. Then, to write a book with chapters whose starting places were based on continuous breaks, we’d be set. The other kinds of break are a little more predictable, as their names tell us what they’ll do. A next-page section break would, in fact, be better for chapter break-points. We could insert one of these at the end of a chapter and immediately start the next.

One last thing: Leave the Show/Hide feature on to remove breaks. Click at the beginning of the break, hit the Delete key (not Backspace—here you want to remove something after the insertion point), and it’s gone. No trouble.

Camtasia SmartFocus Editing Dimensions Error Fix

In Camtasia 9, there is a feature that has been around for a while called “Smart Focus.”  What it tries to do is read the video and zoom in and out when Camtasia feels it’s necessary.  For example, let’s say you were making a screen recording about creating a new folder on your desktop.   When you right click on the screen and the menu pops up, Camtasia’s SmartFocus would hopefully recognize that as a time where it needs to zoom in on the video so the user could more easily see what’s on the screen.

It’s not perfect but if you don’t want to put in all the zooms yourself, it’s a great way to save time.  To find it, open up Camtasia 9, go to Animations, and then the Animations tab, and you’ll see it in the lower right-hand corner:

smartFocusLocation

Once you’ve found it and you try and apply it to a clip, you will see this error:

camtasia smartfocus error

It says, “To apply SmartFocus animations, the editing dimensions need to be smaller than the dimensions of the following media:  insertMediaHere  Would you like to change your Editing Dimensions?”

The way SmartFocus works is you have to record in a higher resolution, and then scale down to be able to use the feature.  For example, you would need to record in 1080p and then change the Camtasia file to a 720p project then you’d be able to add the SmartFocus effect.  So in this example, you’d click yes on the error window and then change your project to 720p and hit apply like this:

camtasiaProjectResolution

Now, if you recorded in 720p and needed to make it smaller than that, well, I wouldn’t recommend doing that.  Your video’s quality would take quite the hit and the video would look pretty bad.  Now before you even go using this feature I would suggest reading this blog post by TechSmith where they basically admit that SmartFocus is broken and that they are trying to figure out what to do with it.  All I’m saying here is proceed with caution and good luck!

If you want to learn more check our Camtasia training and sign up! Have an amazing day!

How to Create a Gradient in Adobe Illustrator

The recent post on meshes in Illustrator kind of leads into a related subject, namely the gradient. Sometimes meshes aren’t necessary, or a little too complicated to set up, but there’s still a need for (at least simulated) shading, and gradients can provide some of this. They take a few steps, but they’re worth it.

(I will mention before I start that the process is a little different than in Photoshop; the nature of the use of gradients is different in each program.)

Gradient panel

Once the file is open, we select the shape we want to put the gradient in, bring up the panel (Window menu–>Gradient), and click the basic gradient to apply it. We can select either Linear (basically bands of color) or Radial (sunburst/circles of color) at the top right of the panel, but the main part of the process is the same from there.

Gradient ramp

Editing the gradient involves the horizontal strip near the bottom of the panel, called the gradient ramp. The house-like shapes below it are color stops; they tell us what colors are in it. The diamonds above are color midpoints, which show where the halfway mark is between two colors. Both of these can be moved, though the midpoints can’t be removed as they automatically show between any pair of colors on the ramp.

Edit gradient

To add colors, we click anywhere immediately below the gradient ramp to add another stop. Double-clicking on the new stop brings up the color controls, where we can use an existing swatch, or create a new color from the sliders. We can even choose other color systems from the dropdown menu at the top right of the controls. Editing existing colors works exactly the same way.  (Tried finding out how many colors I could put in. It got boring around fifty….) Then, if necessary, drag the midpoints to adjust where colors shade from one to another.

Removing colors is easy—just drag the color stop straight down about a half inch, and let go.

Gradient angle

Usually, once we set up the gradient colors, we change the angle if we want. The control is almost dead center, and allows use of the dropdown or typing the angle we want. It’s even possible to adjust the opacity of a color stop, using the control at bottom. According to my students, this is somewhat less common, but certainly invites experiment. Finally, the Location control positions the color stop precisely, if needed.