MovieClip

Create movieclip

The editor supports creating, editing, and using sequence frame movieclips. There are several ways to create a sequence frame movieclip:

  1. Use movieclip editing tools such as Adobe Animate CC / Flash to make movieclips, export the description file with plist or eas extension and related maps (should be placed in the same directory), and then drag the description file (only description file, not map) The editor can generate movieclip material.

  2. Click the menu “Resources”-> “New movieclip”, or click the main toolbarButton to create a new blank movieclip. Then click “Import image Sequence” in the movieclip editing interface to import multiple images.

  3. Drag a GIF file directly into the editor, and the GIF will be automatically converted into a sequence frame movieclip.

  4. Flash projects support direct import and use of SWF files.

Regardless of how the movieclip is created, in the editor, the movieclip material exists as a single file (with the extension jta). In other words, no matter whether the movieclip is created from the image file in the library or imported from the outside, there will no longer be a dependency on a single image. For example, if you drag an image from the asset library into the movieclip editor to create the movieclip, after the creation is complete, these images have no relationship with the movieclip anymore. If you want to set the texture set of the movieclip, set the movieclip in the movieclip editor. The settings for those images are invalid.

Edit movieclip

In the resource library or on the stage, double-click the movieclip to enter the movieclip property setting dialog box:

function button:

Instance properties

Select an movieclip on the stage, and the property panel list on the right appears:

GMovieClip

We generally do not use new directly to create movieclips, and there is rarely a need to create movieclips separately. It is usually placed directly in other components as a constituent element. If you really need to instantiate an movieclip, you can use the following methods:

GMovieClip aMovie = UIPackage.CreateObject ("package name", "movieclip name").asMovieClip;

The commonly used APIs are:

aMovie.playing = false; // Switch playback and stop status
    aMovie.frame = 5; // If the movieclip is stopped, you can set the frame to stop at

Set the loop playback of the movieclip, such as from frame to frame, how many times to loop, etc .:

aMovie.SetPlaySettings(0, -1, 0, -1);

For other controls on the movieclip playback process, you can use the MovieClip object:

// Return to play head
    ((MovieClip) aMovie.displayObject) .Rewind ();

You can get a callback notification when the movieclip is completed: (If it is looped, the playback is not completed until all the loops are completed)

//Unity/Cry
aMovie.onPlayEnd.Add(...);
//AS3
aMovie.setPlaySettings(..., callback);
//Egret
aMovie.setPlaySettings(..., callback, this);
//Laya
aMovie.setPlaySettings(..., Handler.create(callback, this));
//Cocos2dx
aMovie->setPlaySettings(..., CC_CALLBACK_0(AClass::onPlayComplete, this));