Wednesday, February 9, 2011

How To use duplicatemovieclip

Duplicate Movie Clips
       by kirupa   |  2003
Many cool animations or special effects in Flash use the duplicate movie function. The duplicate movie, as its name implies, creates another copy of the movie clip and places the copied movie clip on stage. This tutorial will teach you how to create duplicates of a movie clip when a button is pressed.
Note
The following animation is a good example of the duplicate movie clip function at work (press the plus sign to generate new movie clips):




To make your strenuous programming life easier, I have provided an incomplete source file for you to work on. Don't worry, the source file does not include the ActionScript necessary to duplicate movie clips; you will enable that with information found on this site.
Download Incomplete FLA
Here is how to duplicate movie clips:
  1. Open the duplicate_tutorial.fla file you downloaded from the above link.
     
  2. Select the circle movie clip. Once the circle movie clip has been selected, click the Instance tab to display the Instance panel. In the Name field of the Instance panel, enter the word circle:
[ the movie clip has been given the name 'circle' ]
  1. Now that you have the circle movie clip named, it is time to add some actions to the button. Right click on the button and select Actions. The Object Actions window will appear. Copy and paste the following code into that window:
     
[ copy and paste the above code in the Object Actions window ]
  1. That's it! You are done with entering the code to create duplicate movie clips. Preview the animation and press the plus sign to see new movie clips.
How Does the Code Work?
The following section will basically deconstruct how the code you copied and pasted enables a new movie clip to appear:


on (press) {
    i = i + 1;
    duplicateMovieClip (_root.circle, "circle" + i, i);
}


 
The first line is the On handler for the button. Whenever the user presses the button, the code within the on (press) executes. In this case, a duplicate movie clip is created when the button is pressed.

on (press) {
    i = i + 1;
    duplicateMovieClip (_root.circle, "circle" + i, i);
}
 
This line contains a counter with the variable i. While I could use i++ to increment the value by one, I decided to expand i++ with i = i + 1 to make it easier for you to see that the variable increments each time the button is pressed.

on (press) {
    i = i + 1;

    duplicateMovieClip (_root.circle, "circle" + i, i);

}
 

Before I explain the intricacies of the blue colored code, let me furnish you with the generic syntax that the duplicate movie clip function follows:
    duplicateMovieClip (target, new mc name, mc depth);
The above code should be pretty self-explanatory. The target identifier is the name of the movie clip that you choose to copy. In our example, the movie clip, circle, was going to be copied; hence, _root.circle appears in the target place.
The second identifier gives a name to the duplicated movie clip. When a clip is duplicated, the new movie clip needs to be given a new name. You can enter the name as a string, or as an expression. In my code, the movie clip name is in the format of an identifier. Each time a new movie clip is generated, remember, the variable i increments by one. So, if there are 10 movie clips on stage, the last movie clip will be "circle" + i which is circle10. Therefore, the instance name of the 10th movie clip will circle10. Simple enough!
Movie depth refers to the vertical stacking order of the new duplicate movie clip. The higher the movie depth value, the higher up the movie clip will be on stage. In my example, each movie clip that is created will be higher than the previous movie clip because i is incrementing with each movie clip added onto the stage. To learn how to adjust the stacking order of movie clips, visit the following URL: http://www.kirupa.com/developer/actionscript/swapdepth.asp
Movie Clip Actions
In the previous section, I explained the workings of the code inserted on the button. In this section, I am going to explain the code in the movie clip. The code in the movie clip was already there in the partial source, so don't worry if you do not remember adding that code....you didn't add the code!

Right click on the circle movie clip and select Actions. You will see the following code:
onClipEvent (load) {
   scale = (random(100) + 50)

   this._x = random(250);
   this._y = random(150);
   this._alpha = random(100);
   this._xscale = scale;
   this._yscale = scale;
}
 
The above code plays heavily into OOP (Object Oriented Programming). Because this tutorial does not focus on OOP, I will primarily point you to the following two lines of code:
   this._x = random(250);
   this._y = random(150);


When a new movie clip is created by using the duplicate movie clip function, the movie clip gets placed over the previous movie clip. If you don't have a variable that changes the scale of a duplicated movie clip, you will not notice any discernable change in your animation because all the new movie clips are being stacked on top of each other.
The aforementioned two lines of code applied to a movie clip enable the movie clip to be placed in a random location each time it is duplicated. That. Using the above code ensures that your movie clips are not stacked on top of each other. The values 250 and 150 correspond to the width and height of your movie respectively. You should modify that number so that a new movie clip gets randomly placed within the boundaries of your movie clip.
Adding Duplicate Movie Clip to a Frame
If you want to have duplicate movie clips appear automatically when an animation loads, use the following syntax:

amount = 50;
   while(amount>0) {
   duplicateMovieClip (target, new mc name, mc depth);
   i = i + 1;
   amount = amount-1;
}
Similar to adding actions for a button, use the above format to add the actions to a Frame. The value after amount = is the number of movie clips that will be generated. Adjust the number of movie clips you wish to duplicate by modifying that number.
Downloads
Even though I make every effort to make sure that my tutorials are legible and understandable for all users, I am also not infallible. Therefore, I have provided the final source code for you to see how the animation I used to write this tutorial turned out:

Final Source for this Tutorial
Conclusion
Duplicating movie clips is essential for your Flashing career. Many great animations use the duplicate movie clip function to create spectacular Flash effects. Many of the animations featured on the levitated.net site use the duplicate movie function along with numerous random algorithms to create unique animations: http://www.levitated.net

Tuesday, February 8, 2011

How To Learn Visual C++ 2005

Learn Visual C++ 2005

Visual Studio Team Edition for Software Developers with MSDN Premium Subscription

What Is Visual C++ 2005?

Microsoft Visual C++ 2005 provides a powerful and flexible development environment for creating Microsoft Windows–based and Microsoft .NET–based applications. It can be used as an integrated development system, or as a set of individual tools. Visual C++ is comprised of these components:
Visual C++ 2005 compiler tools - The compiler has new features supporting developers that target virtual machine platforms like the Common Language Runtime (CLR). There are now compilers to target x64 and Itanium. The compiler continues to support targeting x86 machines directly, and optimizes performance for both platforms.

Visual C++ 2005 Libraries - This includes the industry-standard Active Template Library (ATL), the Microsoft Foundation Class (MFC) libraries, and standard libraries such as the Standard C++ Library, and the C RunTime Library (CRT), which has been extended to provide security enhanced alternatives to functions known to pose security issues. A new library, the C++ Support Library, is designed to simplify programs that target the CLR.

Visual C++ 2005 Development Environment - Although the C++ compiler tools and libraries can be used from the command-line, the development environment provides powerful support for project management and configuration (including better support for large projects), source code editing, source code browsing, and debugging tools. This environment also supports IntelliSense, which makes informed, context-sensitive suggestions as code is being authored.
In addition to conventional graphical user-interface applications, Visual C++ enables developers to build Web applications, smart-client Windows-based applications, and solutions for thin-client and smart-client mobile devices. C++ is the world's most popular systems-level language, and Visual C++ gives developers a world-class tool with which to build software.

What Are the Differences Between the Visual C++ Editions?

The Visual C++ 2005 Express Edition is a lightweight, easy to use and easy to learn tool for hobbyist, novice, and student developers who want to build dynamic Windows applications. The Visual C++ 2005 product team has put together a series of Hands-on Tutorial Videos for people who are new to the Express Edition.
For the professional developer who needs the ultimate in power in order to design and produce timely and robust Windows and Web applications, Visual C++ is included with the award-winning Visual Studio interactive development editor (IDE). There are currently three different editions of Visual Studio (all of which include Visual C++). Click here to see a grid comparison of all the Visual C++/Visual Studio editions.

Where Can I Find Sample Applications?

MSDN provides two distinct types of sample applications in order to help developers who are new to Visual C++ 2005 become more productive faster than ever. The first type of sample is a set of walk-through samples, where the developer is taken step-by-step through the process of performing a programmatic task such as extending the famous "Scribble" MFC application to support a plug-in model using .NET to demonstrating the use of reflection in a pure MSIL (Microsoft Intermediate Language) application.
In addition, MSDN also features a Visual C++ 2005 Samples page dedicated to samples that cover every aspect of programming with Visual C++ 2005. This includes such tasks as programming with Standard Template Library (STL), ATL, internationalization, .NET interoperability, Platform SDK and much more.
Finally, if you can't find the exact example you're looking for, we recommend browsing through the list of third-party community sites where you'll find thousands of source-code examples and tutorials.

How Do I Learn More About Visual C++ 2005?

MSDN provides many starting points for learning about Visual C++ 2005 depending on your need. If you're looking for product information such as a feature overview or system requirements, you can visit the Product Information page. On other hand, if you're looking to learn more about the product from a usage (developer) standpoint, here are some great resources that will help get you underway very quickly:
  • What's New in Visual C++ 2005 - Discover all the changes to the libraries, IDE and compiler as well as information on such topics as how to port, or upgrade, your existing projects.
  • Getting Started - This page contains links to such information as supported platforms, Visual C++ settings and how to create and manage your Visual Studio 2005 projects.
  • Guided Tour - For the newcomer to Visual C++, this page could become your best friend as it covers many common tasks such as how to: compile a code example found on MSDN, create a command-line applications, convert between different types, use the IDE more efficiently, create and use dynamic and static libraries and more. There's even a page for Unix developers new to Visual C++.
  • How do I ... ? - As software developers we're always wanting to learn more. Therefore, we've created a page for such inquisitive people where the most commonly asked about topics are categorized for your convenience. For example, if you have a question regarding the performance of a mixed-mode application (containing both native and managed code), you would go to the How-To page and click on Interop where where one of the topics is entitled Performance Considerations for Interop (C++).

How to Get Everything You Want in Life

Get Everything You Want in Life

The biggest drag in life seems to be when routine sets in and you lose all sense of purpose. What makes this even worse is when chaos sets in from some area of life, such as with finances, and causes you to feel like you're losing control over everything. Here's how to get back control and accomplish all the things you want to do.

  1. Realize what you would like to accomplish and why. Many people these days have a lot goals but do not actually realize what they truly want in life. You should worry less of what you want "in" life and more about what you want "from" life. If you find what you want feelings rather than material possessions, this is the article for you.
  2. Begin with making a column. Within the column list out your current situations and brainstorm pathways to get you on the right road success. Reminder: Getting everything you want cannot be done alone. Gathering support from others is always a brilliant way to get your foot in the door. The sky is the limit, and achieving your dreams is something that we all have the privilege to strive for. For many the dream will be lived, and unfortunately for some failure looms.
  3. Identify Obstacles. Make a second column after the first one. In this column, write down everything that's preventing you from accomplishing that task. Be completely honest. If it's not enough money, write it. If it's not enough time, write it. If there is nothing preventing you from getting something done, write that down. Identifying any obstacles that are preventing you from accomplishing anything is one of the most important elements here. This will serve two purposes - it will highlight all the things you can do that you've just been lazy about (such as laundry), and it will give you an idea on what you need to overcome to get those items crossed off your list. What's important to realize at this point is that the underlying cause is, ultimately, that inaction is the number one thing preventing you from doing all these things. This leads you to the next column.
  4. Formulate a Plan. Make a third column and write down a plan of action now that you know what's preventing you from accomplishing everything you want. The reality is that you have to take action, and without having a plan, you'll just keep spinning your wheels and nothing will get done. If one of your obstacles is not enough money, maybe you can write down ideas on how to make more money, how to spend less money, or how to get a handle on your finances. If there is nothing preventing you from doing something, write down that you need to JUST DO IT! If your goal is "Learn to ride a motorcycle", and not having a motorcycle is what's preventing you, write down "find a friend with a motorcycle" or "save money for a motorcycle". Write down anything that comes to mind.
  5. Put Your Plan Into Action. Now that you have a plan, you need to act on it. It is all up to you at this point.

How to Find Financial Help Online

Getting financial help online is possible if you need help in dealing with money troubles or other financial difficulties. You can find a great deal of financial help for your household finances, online loan applications and even applying for a personal loan online with online finance help sites, without paying the cost of high fees.
If you want to seek out free finance online help websites you'll be surprised to find you can organize your household finances and personal money issues for wealth building without paying a cent.
The type of help you can expect to find with online finance sites will come in the from informative articles on managing your personal loan online, household budgeting, free personal accounting software downloads, to advice on debt consolidation, refinances and getting financial aid, household finances and online loan applications. You’ll even find budgeting spreadsheets as well as free software to download as well.

  1. Check out YouTube. There are plenty of resourceful people giving so much advice and how tools on all sorts of money issues.
  2. Use Google Search. This search engine contains millions of sites that give a wealth of information on just about anything from experts covering on topics from investing in gold to bad credit repair.
    • Look for completely free websites to help with personal finances, budgeting and expense tracking that includes a number of helpful tools and suggestions for reducing your expenses and tracking you’re spending.[1]
  3. Understand the benefits of using online financial help. It means you don't have to sit through presentations, waste your gas, pay for parking, or worst, waste your time and money getting the wrong type of advice.
  4. Keep across your finances. Improving your personal finances is a lifelong and rewarding journey. With all the completely free personal finance online help resources available today, you can take hold of your financial life back from your creditors.

How to Add a Credit Card to a PayPal Account


Add a Credit Card to a PayPal Account

You can use a PayPal account to send or receive money to and from banks and other PayPal accounts, or pay directly for online transactions. PayPal also issues a debit card that you can use to access money in your PayPal account, and some employers issue PayPal payments for work done online. Small businesses and individuals can also use PayPal to process credit card transactions without having to contract with a processing service.
When you first sign up for a PayPal account you'll be asked to provide a bank account, debit card or credit card as a source of funds. Even if you don't use a credit card as your initial funding source, you can always link a credit card to your PayPal account later. If you have a credit card with a rewards program, you still get rewards points for PayPal purchases drawn on your credit card. You also have the added benefit of keeping your credit card number confidential.

Steps
  1. Log in to your PayPal account. If you don't have an account yet, go to the PayPal homepage. Click "Sign Up" and then input an e-mail address and password for your new account. You'll receive an e-mail confirmation letter within a few minutes. Click "Activate My Account," in the confirmation letter, to confirm your PayPal account. You will be automatically logged in.
  2. Hover your mouse over "Profile" in the menu bar near the top of your account page. Select "Add or Edit Credit Card." Alternatively, you can click "Profile," and then click "Credit/Debit Cards" under the "Financial Information" heading.
  3. Click "Add a Card," then fill out the required fields: full name, card type, card number, verification number, expiration date and billing address. You can use a debit/check card as a credit card if it has a Visa or MasterCard logo on it.
  4. Wait while PayPal confirms your billing address automatically; this may take up to 30 seconds. Once your credit card is confirmed, it'll be listed in the "Credit/Debit Cards" screen. Only the last four digits and expiration date are displayed.

How to Find Out What Music You Like


Find Out What Music You Like

When it comes to music, most people are undecided. If this is you, and you aren't okay with this, consider reading on. Your choice of music for the future is in the hands of this page!
 Steps
  1. Think about your personality. Are you wild, or quiet? Do you like things slow or fast? Consider these elements before beginning your search.
  2. Compile possibilites. Ask friends to loan you CDs from different genres (i.e. country could be from one friend, rock from another, pop from another...)
  3. Ask yourself yet more questions. Would you prefer music that you can dance to over music you can work to? Do you care if there is swearing or not?
  4. Try out CDs and look up your favorite artists from them on itunes or Amazon.com. You can preview the songs and get a small taste of what they are really like.
  5. Go to www.youtube.com. There you can watch music videos of the songs you chose on itunes.
  6. Go to your chosen artist's official site and fan site(s). It doesn't matter if they are well known or not, you've just found what kind of music you like!
  7. Try out lots of different kinds of music. Not all music makes the radio. Don't limit yourself to what's popular or well-known because you could be missing out on some great music.
  8. Try your local public library. Most public libraries have a variety of music on CD that you can check out for free or interlibrary loan for a small fee.
  9. Listen to the radio. You can try the radio stations in your area or any of the various online radio sites. Some online radio stations broadcast what's on the air somewhere; others play mixes based on what you say you like. Try Pandora or Last.fm for two examples of sites that recommend music based on recommendations from others who like what you like.

Monday, February 7, 2011

How to Buy a New Car Through Fleet Sales

Get a better price and spend less time on the lot.
Get a better price and spendless time on the lot.
If you're buying a new car, you may want to consider going through fleet sales. Fleet sales are aimed at business buyers, people buying cars for companies, but many fleet departments will sell to the public when asked. It can be an easier way to buy a car, with a minimum of negotiation and time spent at the dealership. Since you're essentially buying wholesale, it can get you a better deal on the car you want.



Steps

  1. Know what you want. Dealing with fleet sales will not only save you money, but it'll also save you time. Unlike the retail salesperson, a fleet seller isn't going to spend hours trying to persuade you to buy a particular car as you mull over your decision. They're trained to sell cars cheap and fast.[1] Know what model, options and colors you want before you contact a fleet sales department, and you'll get the most out of your transaction.Save upto 55% on insurance from 20 insurers. Get Free Quote
    • Know what prices are available. Knowing the dealer's invoice price (what they paid for the car) and MSRP are important, but the key is to know the dealership's volume discount. Virtually all dealerships and fleet companies work on volume discounts. For example, a dealer might pay $20,000 for the car, but they might get a $3000/car rebate at the end of the year, completely negating their invoice price. Knowing the dealer's invoice price is only a very small part of the equation. Most dealer's would be happy to sell you a car "at cost" or below, knowing the real profit is in the volume bonus. Most dealerships will not hesitate in giving you this information, if you ask. Many online tools will also reveal this information. Most dealerships get anywhere between $200,000 and several million dollars in volume bonuses; hence, their 'invoice price' is not usually a true representation of their costs. But knowing the vehicle's MSRP is always a good place to start.
    •  
    • Test drive the car.
       
      Try the car you want. Go to any dealership and ask to test drive the car you're interested in. Don't even mention fleet sales yet. This is still the research phase. Make sure you fit in it. Make sure it handles comfortably. Take friends and get their opinion on how the back seat feels. Remember, you are about to spend a lot of money and a lot of time in this car.
    • A spreadsheet can help you keep track.

      Write your specification. Decide what model, color, trim, and options you want on your car. This is your specification. Decide what parts of your specification are optional or negotiable. If you would prefer slate blue but will consider cobalt or want but don't require a sun roof, write that down, but don't disclose it right away. You can negotiate on these optional points later, if it makes sense to do so.
  2. Prepare financing for your car. If you will be purchasing your car on a loan, visit your credit union or bank and learn what rates are available. Get your own financing lined up. You can make this part of your negotiation later, but pin down the price and vehicle you want first.
  3.  
  4. Make contact by phone, fax, or email.

    Shop around. When you know exactly what you want, you can save a lot of time calling around to different dealers in your area to find out what they have available and whether their fleet department deals with the public. It can be a little tricky, however, because retail salesman will want to divert your shopping to their own department, sometimes even pretending to be fleet salesmen.[2]
    • Before saying anything, ask the operator or receptionist for the name of the fleet manager. If you are asked why you wish to know the fleet manager's name, say that you're doing research for your company's upcoming car purchase. Be as insistent as you need to be. Once you get the name, ask to speak to the manager and tell him/her that you are interested in buying a car soon. Give a specific time frame (e.g. three days, by the end of this week) to show that you're serious (and mean it!).[3] If the manager asks which business you're affiliated with, give the name of the company you work for.[4] Don't feel the need to lie, however, and say the car is for business use when it's not. Fleet managers are allowed to sell to private buyers, and if you handle the process professionally (rather than like the average undecided consumer) then the manager should have no problem doing business with you.
    • Specify what you're looking for. Phone, fax, or email your specification to the fleet departments or managers at several dealers with a request for bids. Again, be sure it gets to the fleet department by using specific names and direct phone numbers or e-mail addresses. Note on the request for bids that you would like their best price and that you are asking other dealers. It should help to shorten the process. If you are willing to wait for the car you want to be ordered or transferred from another dealer, state that. If they have what you're looking for, make an appointment. If all you get is an invitation to come to the dealership without any kind of bid attached, ignore it; they probably don't have what you want and are hoping to convince you to get something else.[5] If they send you a bid that doesn't match exactly with your specifications, circle any discrepancies so you can ask about them later.[6]
    • Contact as many dealerships as you can until you find one that has exactly what you're looking for. Your area, as far as car dealerships are concerned, should be pretty big. If you can save $500 or $1000 or more by going to another dealership, or get something much closer to what you want, it can be well worth a one-time drive to a dealer a few towns away. Wait for the various dealerships to respond with a quotation and compare the offers. Read carefully.
    • Call during regular weekday business hours. Fleet managers and salesmen deal with businesses, which usually operate on that schedule.
  5. Negotiate. Contact the dealerships with the most attractive bids. If they left off or added a particular item, ask why, and ask them to requote the vehicle based on your specifications within 24 hours. In all of your phone calls, e-mails, and faxes (except to the dealership with the best offer), tell them what your lowest bid was and from what dealership (be honest!) and ask "Can you beat this?" Sometimes a dealership that's more "out of the way" will bump their selling price a few hundred dollars to move a stale car off their lot. After doing this, take your two lowest offers, and call the dealership with the higher one. Make a firm offer to buy the car at a price that's slightly lower (maybe $200) than the lowest bid; if they say yes, ask them to fax you that bid immediately and make an appointment to fill out the paperwork and buy the car. If they say no, call the dealer with the lowest bid and make an appointment to fill out the paperwork and buy the car (don't negotiate).[7]

    • Models that are in high demand or that are sold firmly at MSRP (Saturn, Scion) will not fetch lower selling prices through this kind of negotiation.[8]
    • If you're not seeing bids that you like, consider expanding your dealership radius, or shopping for a different car.
    • Starting this process a week before the end of the month will get you better bids because that's when most dealerships are eager to move inventory.[9]
  6. Go to the dealership. Ask for the fleet manager by name. Be courteous and brief--that's how the fleet manager or salesman will usually be. Ask to see the car you're considering. Inspect it carefully and test drive it. (Even if you've test driven that exact model already, sometimes individual cars have manufacturing variations, and it's worth taking a quick spin to make sure everything's in good shape). Don't expect the salesman to be sputtering information or gushing with advice. You can ask to see the vehicle's actual factory invoice if you want, but the price is usually not negotiable, especially if you've gone through the bidding process as outlined earlier. The salesman won't negotiate for the same reason he won't pressure you--there's not a lot of wiggle room, and he's not trained to squeeze profits; he's trained to sell in bulk.[10] A simple "Is this the best price you can offer?" will open the door to any negotiation that might be possible; you don't need to haggle here. Make a decision to buy, or thank the salesman for his time and leave.
  7.  
  8. Ask if they can have all the papers ready for you.
      papers ready for you.