Archive for October, 2009

The main advantage

The main advantage of printAsBitmap is that alpha transparencies can be printed; so if you have semitransparent graphics, you will need to use this. It also works with a wider variety of print devices.

The print command has the advantage of producing nice, smooth curves and text on higher-end printers. It may also be faster if printing over a network.

A good general rule to follow is to use printAsBitmap at times when you want to be assured that printing works and that the results mirror what is seen onscreen. Use print when accuracy is not critical or when you are making the movie for a controlled environment like a corporate intranet.

If you are streaming your movie over the Internet, note that printing should work only after all the frames you want printed have loaded. You may just want to check to make sure that the whole movie has been loaded before allowing the user to print. See Hour 23, “Managing Movie Streaming,” to learn about streaming and how to detect whether a movie is fully loaded.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

Best Hotel Locator for Best Vacation in Paris

Hotel is one of the important things in vacation. If you can’t get the best hotel for your vacation, you will have a worst vacation in your life.

Therefore, if you’re planning to have a vacation in Paris, there’s one place that can help you to get best Hotel paris, Bedandbreakfastparis.biz. Here you will find a simple feature to get best choice of hotel in Paris. But, if you want get luxury staying place in Paris, you also can use this feature to find appartements luxe paris.

This website also has unique Paris sightseeing tours map that will give you best information about beautiful and interesting spot in Paris. So, this website won’t just help you to find best hotel, but also find best spot to visit. So, visit now and use this service.

No Comments

The third option is bmovie

The third option is bmovie. In this case, you need to do a little more work. You need to create a frame in your movie that has a box on it. This box determines the maximum size to be printed. You must label this frame with a #b label. Then Flash uses the size of the box on this frame to determine the scaling to use on all frames printed. If there is something outside this area on a frame to be printed, it should not appear on the printout.

As you can see, the boundary option is actually passed in as a string. You must put quotes around it.

You can see an example of the print command in action in the movie 20piechart.fla.

PrintAsBitmap
The companion command to print is printAsBitmap. This command works just like print, with the same two parameters.

The difference between print and printAsBitmap is that print actually sends vector graphics and fonts to the printer. The printer then re-creates the vectors and text when building the page.

On the other hand, printAsBitmap converts the entire screen to a large bitmap image and sends that to the printer.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

The Print Commands

There are two primary print commands. They have slightly different uses but work basically the same.

Print
The first is simply print. This command takes two parameters. The first is the target to be printed. Usually this is the main timeline, or _root. You can also use this. However, if you do want to print frames inside a movie clip, you can use a reference to that clip.

The second parameter is one of three options: bframe, bmovie, or bmax. These relate to how Flash scales the frames printed.

Flash scales the printable material up to the size where it fills the page as much as possible without distorting it. So if a frame is 550×400, it will most likely make the 550 pixels of the frame fit across the page. The vertical dimension will remain proportional.

If you use the bframe option, each frame printed scales to its own size to fill the page. If one frame fills 550×400 and a second frame has content that only fills 275×200, the second frame scales to twice the size of the first, so that they both fill their pages as much as possible.

If you use bmax as the second parameter, Flash examines all of the frame to be printed to determine which is the largest. It then chooses the scaling of all pages based on that one page. This keeps each frame the same relative size. So if a 550×400 screen is the largest, it fills the page. But a 275×200 screen in the same movie fills only half the page.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

You can organize this using

You can organize this using the main timeline layers. For instance, you could have Print and navigation buttons on separate layers from the page’s content. These layers, which you do not want printed, will not extend to the print frame.

Figures 20.2 and 20.3 illustrate this kind of system. Figure 20.2 is the frame that the user sees on the Web page. It features the content, a navigation button, and a Print button.

On the other hand, Figure 20.3 shows a frame that the user never sees—at least not on the screen. It is labeled with a #p, which you can see in the timeline. The Buttons layer does not use the same key frame as the previous frame. Instead it uses a new key frame that excludes the button but includes additional information meant for the printout only.

Now that you know how to prepare your movie, let’s look at the ActionScript needed to print.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

shows a timeline

shows a timeline with two frames labeled for printing. Notice that those same frames are also labeled in another layer. You can place more than one label on a frame this way. This comes in handy because you probably don’t want to use #p as a real label, and you may want to have more than one frame with a #p label.

When you label more than one frame with a #p, you will get a warning when you test the movie: “WARNING: Duplicate label…”. It is unfortunate that this happens, but it will not affect your movie unless you try to use the #p labels in gotoAndStop commands and such.

A Printing Strategy
You really need to think ahead to build printing into your movie. Because you can’t just print the current frame, you will need to build special printable frames.

Note that everything visible on the frame gets printed. This includes a Print button, if you have one, plus any navigation buttons. So you probably want to have a Print button on one frame, and then have a frame that is identical to that one but without the Print button or other unwanted elements. This frame has the #p label on it.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

Setting Up Your Movie for Printing

You need to do a few things to your movie before you can use any ActionScript print commands. Unfortunately, the print commands are not versatile. If used without any preparation, they will print the entire contents of the movie, frame by frame.

This is usually not what you want. You may want only the current frame printed, perhaps a frame inside a specific movie clip, or maybe a small series of frames. But rarely will you want every single frame printed.

Labeling Frames for Printing
You specify that a frame should be printed by labeling it with a #p. If you don’t place a #p label on any frame, the print commands will print all frames in your movie. On the other hand, if you place more than one #p frame in your movie, just those frames will be printed.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

What two steps need

What two steps need to be done to insert a new node into an XML document?

A3: You need to first use createElement or createTextNode to make the node and then use appendChild or, alternatively, insertBefore, to put the node in the XML object.

4: How would you get to the text “Hello World” in the document Hello World!?

A4: The text is the nodeValue of the first child of the first child. So you could do this: myXML.childNodes[0].childNodes[0].nodeValue.

Hour 20. Printing
Although not as complex as browser or server communication, printing is another way that Flash communicates with the outside world. Flash’s printing capabilities are useful because they allow you to build documents that the user can print from inside your interface. This is often a better design option than relying on the browser’s print function.

In this hour, you will:

Learn how to set up your movie for printing

Find out how to use the print commands

Create a printable form

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

Isn’t recursion supposed

Isn’t recursion supposed to be some difficult concept that only expert programmers understand?

A4: Although it is true that some people have trouble understanding the idea of a recursive function, many non-programmers can see how it works. However, don’t be frustrated if you don’t get it. Many freshmen computer science students switch majors shortly after trying to learn recursion.

Workshop
The quiz questions are designed to test your knowledge of the material covered in this hour. The answers to the questions follow.

Quiz
1: How many nodes are shown in Figure 19.1?

A1: Five. There are three elements and two text nodes for a total of five nodes.

Name the nodes in the XML document Hello World!.

A2: There is the test node and the text node under it containing “Hello World!”.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

Q&A

Can I use Flash to create and send XML documents?

A1: Sure. You can populate an XML object and then use send to send it to a server just like you would with the LoadVars object.

Q2: How do I know whether to use XML documents or lists of variables like what LoadVars expects?

A2: Use XML in cases where the data is already in XML format. You can also use it if you are building the system and feel like XML is needed. However, for small pieces of data, you should be able to stick with plain text files.

Q3: Can I remove nodes from an XML object?

A3: Yes. There is a removeNode command that will delete one. Read the XML section of the documentation for a complete list of commands and properties.

Taken From: Sams Teach Yourself Flash™ MX ActionScript in 24 Hours

No Comments

  • Partner links