EXLUSIVE ADS

Dapakan Alat Pengencang Wajah yang Revolusioner Alat Pengencang Wajah yang terbukti dengan hanya 15 menit pakai kerutan halus hilang dan kulit wajah lebih kencang terlihat lebih muda....

Friday, February 23, 2007

For ajangkenalan Creating New Movie Clips Based on Existing Movie Clips

ajangkenalan
Recipe 11.9. Creating New Movie Clips Based on Existing Movie Clips
Problem
FlashMX MultiRental.3pod rental sewa projector proyektor lcd infocus plasma soundsistem jakarta proudly present
You want to create a duplicate movie clip instance based on an existing instance.
Solution
FlashMX MultiRental.3pod rental sewa projector proyektor lcd infocus plasma soundsistem jakarta proudly present
Use the duplicateMovieClip( ) method.
Discussion
FlashMX MultiRental.3pod rental sewa projector proyektor lcd infocus plasma soundsistem jakarta proudly present <http://greateventsupport.com/fireworks/changing-paths-appearance/changing-swatch-groups.html>

With the duplicateMovieClip( ) method, you can quickly create duplicates of movie clip instances already on the stage. This method creates a copy of the movie clip instance from which it is invoked with a new instance name and depth:
// Create a new movie clip named mNewInstance based on the movie clip named
// originalInstance that already existed on the stage. The new movie clip is
// created at depth 1.
mOriginalInstance.duplicateMovieClip("mNewInstance", 1);


Additionally, you can specify a third, optional parameter for the duplicateMovieClip( ) method. This parameter is known as the initialization object, and the properties and values of the initialization object are assigned to the new instance. The parameter value should be in the form of an ActionScript Object object, which you can create one of two ways: <http://greateventsupport.com/filezilla/file-views/index.html>
· Using the constructor and assigning properties and values via dot notation:
· var oInitialization:Object = new Object();
· oInitialization.property1 = "value1";
· oInitialization. property2 = "value2;

· Using the object literal notation:
· var oInitialization:Object = { property1: "value1", property2: "value2"};

Both of these techniques are absolutely valid, and neither is better than the other. Sometimes you may find that you want to use the object literal notation, because it allows you to create the object in line with the duplicateMovieClip( ) method:
mOriginalInstance.duplicateMovieClip("mNewInstance", 1, { property1: "valeu1",
property2: "value2"});

However, in other cases, the object literal notation is either inconvenient or impossible. Generally, the more properties you want to assign to an object, the more it makes sense to use the constructor technique, because it offers a much more readable format. <http://greateventsupport.com/freehand/freehand-lessons/freehand-tutorial.html>
var oInitialization:Object = new Object();
oInitialization. property1 = "value1";
oInitialization. property2 = "value2";
mOriginalInstance.duplicateMovieClip("mNewInstance", 1, oInitialization);

The initialization object, or init object, can be extremely useful in at least two ways:
· You can use the initialization object to initialize the new instance with its own values for built-in movie clip properties, such as _x, _y, _rotation, and so on. By default, the duplicate retains the values for these properties from the original movie clip.
· // Create a duplicate movie clip positioned at 300,300.
· mOriginalInstance.duplicateMovieClip("mNewInstance", 1, {_x: 300, _y: 300});

· You can use the init object to initialize a new instance with copies of the custom method definitions (such as event handler methods) of the original movie clip. By default, custom method definitions are not copied from the original to the duplicate movie clip. However, you can use a for… in loop to populate an initialization object with all the custom properties and methods of the original movie clip, and then pass that initialization object to the duplicateMovieClip( ) method:
· // Create the init object.
· var oInitialization:Object = new Object();
·
· // Use a for…in loop to loop through all the custom properties and methods of
· // the original movie clip instance, and add them to the init object.
· for(var sItem:String in mOriginalInstance) {
· oInitialization [sItem] = mOriginalInstance[sItem];
· }
·
· mOriginalInstance.duplicateMovieClip("mNewInstance", 1, oInitialization);

You can use a for statement to create multiple duplicates at the same time. The basic syntax is as follows:
for(var i:Number = 0; i < numberOfDuplicates; i++) {
originalInstance.duplicateMovieClip (newInstanceName, depth);
}

When you create the new movie clips, make sure each has a unique instance name and a unique depth. Typically, you can generate unique instance names by concatenating the for statement's index variable value with a base name. For example, you might use a base name of mSquare and concatenate that with the value of the for statement's index variable to get instance names of mSquare0, mSquare1, mSquare2, and so on. Then, for the depth, you can either use the value of the for statement's index variable or you can use the getNextHighestDepth( ) method that is discussed in ajangkenalanajangkenalanRecipe 11.10. The following example creates five duplicates with instance names mSquare0 through mSquare4:
for(var i:Number = 0; i < 5; i++) {
mSquare.duplicateMovieClip("mSquare" + i, i);
}

<http://greateventsupport.com/freehand/swatches-panel/system-requirements.html> When you generate duplicate movie clips in batches as shown in the preceding code, you may notice that you don't have a very convenient way to refer to the new instances. When you create a single duplicate with a specific name, you can refer to the new movie clip quite simply. For example, the following code creates a duplicate of mCircle with an instance name of mNewCircle. Then it applies an onPress( ) event handler method to the new movie clip.
mCircle.duplicateMovieClip("mNewCircle", 1, {_x: 100, _y: 100});
mNewCircle.onPress = function():Void {
trace("You clicked on mNewCircle.");
};

However, when you use a for statement to create the duplicates with dynamic instance names, you need a different way to refer to the new movie clips. For example, if you are creating duplicate movie clips with instance names mSquare0, mSquare1, mSquare2, and so on, you cannot use the following code to assign an onPress( ) event handler method to them after you've created them:

Sunday, February 11, 2007

Adding Sound to Your Web Pages For ajangkenalan

ajangkenalan

Classes Versus Objects
Objects, as discussed above, are software packages that contain data and the
procedures that act on that data. Classes are groups of objects that share the
same behavior; they are templates that define what each object of that class
looks like by specifying what the data is and what the procedures are.
Instances are the actual implementations or realizations of a class; the "real" ajangkenalan
things that a class describes. Each instance is a separate entity and many
http://greateventsupport.com/freehand/freehand-lessons/freehand-tutorial.html
developer.com - Reference
file:///D|/Cool Stuff/old/ftp/Creating.Web.Applets.With.Java/cwa09fi.htm (3 von 24) [12.05.2000 14:54:11]
instances of a class can exist at one time. Instances have values in the data
variables. Even though two or more instances may have exactly the same data
values, they are still separate things. Tech Ed
Maybe i'm missing something, but wasn't what I wrote basically a simplified
version of this? -Ken
http://greateventsupport.com/fireworks/changing-paths-appearance/changing-swatch-groups.html
Before you can start building objects, you need to understand a couple of the
more confusing aspects of object-oriented programming. Remember this
sentence: Classes are templates, and objects are instances.
In Java, when you want to create a new type of object, you can't just make
one. You must first make a blueprint, or template, of the object you want to ajangkenalan
create. From this template, you can make as many objects as you want. Think
of it as a software cookie cutter.
http://greateventsupport.com/filezilla/file-views/index.html
Objects are known as instances of classes. The template has been used to
create an object, and the object now exists virtually inside the computer. You
can think of an object as the cookie that the cookie cutter creates. If things
seem confusing, don't worry. The next section gets to the process of making
objects, and things should get much clearer.