Overhead of Movie Clips vs Sprites

I want to understand something, and there is no other reason that I just want to understand.

Again and again, I read that the Sprites have fewer resources than to a Clip. But nowhere someone explains why. They say just use a Sprite if the MovieClip doesn't have a timeline as a Sprite is less demanding in CPU.

Let's say you want to remove an object from a library and change its size. (and let's say that the symbol editing mode has only a picture)

var myMC:MovieClip = new thing();

addChild (myMC)

myMC.scaleX = 1.2

myMC.scaleY = 1.2

COMPARED TO

var mySprite:Sprite = new thing();

addChild (mySprite)

mySprite.scaleX = 1.2

mySprite.scaleY = 1.2

What happens in memory, which makes the MovieClip have more overhead? Something get more exported when the movie is published with instantations unnecessary MovieClip rather than Sprites? Should the Flash Player do additional with the statements of MovieClip stuff that if these same MovieClips were declared as Sprites? Or????????

I realize the difference in overhead is probably negligible with some of these objects. But if you have several hundred then why is a Sprite better? What happens with a MovieClip which does not happen with a Sprite that increases the amount of overhead?

Thanks for any help to understand this!

The schedule and the need for the dynamic nature of it. There is no timeline in a Sprite. This is 1 frame with as many layers as you like (objects on the display list).

Probably as much as the calendar and the futility of dealing with functions, MovieClip is a class dynamic, while Sprite isn't. It's huge. Anything marked dynamics is subject to expansion and by reducing on the fly, which causes memory allocation predictive excess. A Sprite does not suffer what you cannot change its default nature without its extension, and therefore, the compiler knows exactly how to allocate effectively for it.

MovieClips are usually created in the Flash IDE. A host uses the timeline and on a number of images creates any type of animation they want. The MovieClip class to support a large number of features a Sprite isn't. You can't gotoAndPlay() on a Sprite, etc..

This does not mean that a Sprite has no frames. You can assign an Event.ENTER_FRAME loop to a Sprite and see that he works at the document frame rate and therefore you can liven things up with the code inside a Sprite just as if it were a MovieClip. You cannot create a chronology in the code, so you don't need the functions requiring only a timeline.

The reduction of these costly needs (dynamic and extra functionality) are overhead costs that result in a degradation in performance.

http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/display/MovieClip .html

http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/Flash/display/sprite.ht ml

Tags: Adobe Animate

Similar Questions

  • Images of iPod touch - volume of the .mov clips

    Hello

    When I use an iPod touch pictures, the .mov clips sound volume is too low, even if I turn as hard as possible in Final Cut. How can I get stronger?

    Thank you!

    Unfortunately, it really isn't that you can do. You could make a new project and put just the clips that need to be more strong in there, then set volume as loud as it goes, then export than as a video, and then import that new video in your regular project (except that it is strong this time) and you can increase the volume at maximum again. If all goes well, which should help. However, the quality may be slightly reduced.

  • Cannot move clips to the timeline.

    Mac OSX: 10.11.2

    Premiere Pro: 10.4.0

    I had problems with Premiere Pro on 10.3 and 10.4. At this point, I just want to get either version working.is curr

    10.3 hangs at startup despite uninstalling all my Red Giant Software

    10.4 opens but when I try to move clips no matter where it just doesn't happen. Cannot move bins clips or timeline. And when I opened an old project, I can't move clips autour on the timeline even if they are already there.

    Any help is greatly appreciated. I know there are many of you who know what it's like to not be able to get the software you paid for work. It's frustrating say the least!

    Removal of the preferences has worked. So far, 10.4 works!

  • [JSFL] Have a name binding class by name of movie clip

    Hello

    I have a few question doing this. As I do this for some time, I wanted to try a jsfl script instead of doing it manually every time.

    My library will look like this every time.

    2015-12-15_11-30-42.jpg

    What I would like: ave in the end:

    2015-12-15_16-31-01.jpg

    What I want is simple, I want to just take the name of each clip and paste it into the link attribute.

    If the name was easy enough, but as it was the full path, I needed to cut it, so I used the substring.

    But then, despite my attempts, I can't paste the name into the binding attribute.

    It won't take my last sentence: "fl.getDocumentDOM (). library.items [i] .className = newClassName;

    Any ideas?

    Here is the code:

    function init()

    {

    fl.outputPanel.clear ();

    var i = fl.getDocumentDOM (). library.items.length;

    var lib = fl.getDocumentDOM () .library;.

    While (i)-

    {

    If (fl.getDocumentDOM (). library.items [i] .itemType == "movie clip")

    {

    getName = fl.getDocumentDOM () var. library.items [i] .name;

    newClassName = getName.substring (20, getName.length);

    FL.trace (newClassName);

    () fl.getDocumentDOM. library.items [i] .className = newClassName;

    }

    }

    }

    init();

    Finally got my code works with a few more lines.

    Well, I just needed to add "item.linkageExportForAS = true;". Of course...

    function init()

    {

    var i = fl.getDocumentDOM (). library.items.length;

    var lib = fl.getDocumentDOM () .library;.

    While (i)-

    {

    var point = lib.items [i];

    If (lib.items [i] .itemType is "movie clip")

    {

    if(Item.linkageExportForAS==false)

    {

    getName var = lib.items [i] .name;

    newClassName = getName.substring (20, getName.length);

    item.linkageExportForAS = true;

    item.linkageClassName = newClassName;

    }

    }

    }

    }

    init();

  • 2 problems with CS6 - Movie Clip not seen & interpolations added to the library

    Occasional user of Flash. I need to edit a project which began in CS6, so I prefer to leave in this version. Once I started to edit the project, I noticed two things happening. Video clips animate not when previewing in the program. However, the Movie Clips animate properly in the preview publish and published format. The second question, each classic Tween I create is added to the library. I don't remember these two questions when originally, I worked on the project. Is there something I could have changed (preferably, option, etc.) to cause these issues? TIA

    There the scripts inside the movieclip? The instance is defined as a movieclip or a chart?

    Something in the way, as long as you have not used the OS TLF or IK, you should be able to work on the file in CC and still open ok in CS6 later.

  • Using CS4 Flach and action script 2.0 how to move a specific frame in the main timeline when a movie clip instance come at the end of his chronology?

    Using CS4 Flach and action script 2.0 how to move a specific frame in the main timeline when a movie clip instance come at the end of his chronology?

    code on the last frame of your movieclip instance:

    _root.gotoAndStop ('whatever_frame');  will work unless this swf is loaded into another swf.  in this case, you must use a relative path to the main timeline (for example, _parent or _parent._parent etc.).

  • I can't move clip source window to the timeline by grabing it with the mouse.

    I can't move clip source window to the timeline by grabing it with the mouse. I can cut it short it. Once that there I can't move at all

    If first is weird, restart your computer, open the first while pressing SHIFT + alt up to the Welcome screen.

    See if this will help.

  • AS3: see the hide the elements of the movie clip, single button array.

    Hello and please forgive my Noobdity I teach myself AS3 and stuck on what are obviously the basics.

    I did the simple animations for years without using any AS3 at all, the time has come to take seriously.

    I read the daylights out of all reference documents Adobe now but I am stuck on this task.

    I have 4 objects of movie clip whose visibility I control with two buttons.

    First button, two of these visible clips and the other two will make visible = false

    For example: Mc1 and Mc2 > visible, Mc3 and Mc4 > visible = false

    The second button run the same function but in reverse

    Eg: Mc1 and Mc2 > visible = false, Mc3 and Mc4 > visible

    I've determined correctly or incorrectly reading endless and looking for a table should be the best way to do it.

    I may have to use the child feature add but * shrugs, I'm lost atmo

    I've been blunders on the code for the first of two simple buttons.

    I start slowly form a mindmap what should be done, but it's early days.

    Here is my code and please feel free to

    Last attempt tries to use the mouse on the trigger to control the visible state of the second two clips.

    var wcArray:Array = [myMovieclip1, myMovieclip2];

    var acArray:Array = [myMovieclip3, myMovieclip4];

    acComp_btn.addEventListener (MouseEvent.CLICK, _acComp);

    internal _acComp(e:MouseEvent): void {}

    for each {(var point: MovieClip dans acArray)}

    Item.visible =! item.visible;

    }

    }

    acComp_btn.addEventListener (MouseEvent.MOUSE_OUT, _wcComp);

    internal _wcComp(e:MouseEvent): void {}

    for each {(var point: MovieClip dans wcArray)}

    Item.visible =! item.visible = false;

    }

    }

    Currently run 1050 error: impossible to assign a value, not reference.

    The text in blue works with 2 clips of film acArray of course, where the attempt to use the mouse on.

    Any advice on the solution or the best method to implement would be greatly appreciated.

    For what you're trying to make a table is more complication than a solution, you have already divided in two arrays anyway probably due to this tax... and have two buttons to do isn't necessary, but you may already be knowing that since you have only code for one of them in any case.

    All you need is a button that activates the visible properties to their opposites.

    var array: Array = [myMovieclip2, myMovieclip3, myMovieclip1, myMovieclip4];

    myMovieClip1.visible = myMovieclip2.visible = false;  or the other two... depending on what initially as invisible

    btn.addEventListener (MouseEvent.CLICK, _acComp);

    function _acComp(e:MouseEvent): void {}

    for each {(var point: MovieClip dans tableau)}

    Item.visible =! item.visible;

    }

    }

    LF, you must have two buttons to do the opposite, as you say, then clicking on buttons must end up affecting all the buttons, no not only one of the tables you have done.  If each button should do what you say, then you should not use the! operator since that can go the opposite of what you intend, so you must assign the desired state.

    var wcArray:Array = [myMovieclip1, myMovieclip2];

    var acArray:Array = [myMovieclip3, myMovieclip4];

    acComp_btn.addEventListener (MouseEvent.CLICK, _acComp);

    function _acComp(e:MouseEvent): void {}

    for each {(var point: MovieClip dans acArray)}

    Item.Visible = false;

    }

    for each {(var item2:MovieClip in wcArray)

    Item2.Visible = true;

    }

    }

    wcComp_btn.addEventListener (MouseEvent.CLICK, _wcComp);

    function _wcComp(e:MouseEvent): void {}

    for each {(var point: MovieClip dans wcArray)}

    Item.Visible = false;

    }

    for each {(var item2:MovieClip in acArray)

    Item2.Visible = true;

    }

    }

  • Using the ActionScript 2.0 Movie Clip Variable Array

    I just want to use several movie clip attached as table, btw, it's the simple code:

    if(_Global.pLevel == 0)
    {
    var box1:MovieClip = _root.attachMovie ("flip_box_lg", "fb1", this.getDepth () + 5, {_x:100,_y:100});})
    Box1._width = 100;
    Box1._height = 40;
    Box1._x = 60;
    Box1._y = 80;
    var box2:MovieClip = _root.attachMovie ("flip_box_lg", "fb2", this.getDepth () + 6, {_x:100,_y:100});} ")
    Box2._width = 100;
    Box2._height = 40;
    Box2._x = 170;
    Box2._y = 80;
    this.onEnterFrame = assignF;
    }

    Can I just making it like that?

    for (var i = 0; i < 6; i ++)
    {
    [i] var box: MovieClip = _root.attachMovie ("flip_box_lg", "fb" +(i+1), this.getDepth () + 5, {_x:60+(i*110),_y:80});})
    }

    Thank you before

    use:

    var box: Array = [];

    for (var i = 0; i)<>
    {
    Box.push (_root.attachMovie ("flip_box_lg", "fb" +(i+1), _root.getNextHighestDepth (), {_x:60+(i*110),_y:80}));}))
    }
  • Movie Clip Visible after 5 sec

    Hello

    I have 3 Movie clips foam1, foam2, foam3

    they are visible after 5 sec on the hit with scratch movieclip test

    scratch.onEnterFrame = function() {}

    this.startDrag (true);

    };

    scratch.onRollOver = function() {}

    If (this.hitTest (_root.soap1)) {}

    foam1.gotoAndPlay (2);

    }

    else {if (this.hitTest (_root.soap2))

    foam2.gotoAndPlay (2);

    }

    Else if (this.hitTest (_root.soap3)) {}

    foam3.gotoAndPlay (2);

    }

    };

    then use

    setTimeout(visibleF,5000,whatever)

  • Cannot add event listener to instantiated Movie Clip

    Hi guys,.

    I have a clip that I'm loading dynamically in my scene when a key is pressed.  Then, I would like to add a mouse event listener to the Movie Clip object so it can trigger a function when clicked.  I get an error when you try to do this and cannot find a solution anywhere.

    Here is my code:

    newLayerBT.addEventListener (MouseEvent.CLICK, newLayerBT_CLICK);

    function newLayerBT_CLICK (MouseEvent): void {}

    layerCount = layerCount + 1;

    Make a new object in my class BlankLayerMC

    var newLayer:BlankLayerMC = new BlankLayerMC;

    addChild (newLayer);

    Position the new object

    newLayer.y = prevY + newLayer.height;

    Change the text inside the object in order to take account layerCount courses

    newLayer.layerName.text = 'Layer' + layerCount;

    newLayer.layerNum = layerCount;

    prevY = newLayer.y;

    My problem occurs with this line...

    newLayer.addEventListener (MouseEvent.CLICK, moveSelection);

    layerArray.push (newLayer);

    }

    function moveSelection(e:MouseEvent):void {}

    var t = e.target;

    layerSelectedGraphic.x = t.x;

    t.y = layerSelectedGraphic.y;

    }

    Any help would be greatly appreciated

    change:

    function newLayerBT_CLICK (MouseEvent): void {}

    TO:

    function newLayerBT_CLICK(e:MouseEvent):void {}

  • Move clips on the timeline each in its own way?

    Hello

    IM asking it's once again on its own thread, I hope someone can answer.

    How can I move clips from the bin of media in the timeline so that each clip runs on its own track instead of one after the other on a track?

    Thank you

    Saami

    Select items in the project window,

    Right click and click on Create Multi cam source sequence.

    You now have a multicam sequence in the project window.

    Click on this and open it in the timeline.

  • Move the container sprite as the movement of the mouse

    Hi all

    I am developing a game where there is an object that follows the mouse. There are also other objects and a map on the screen. I feel like any content background (the entire map and other items) to move when the user moves the mouse to the left or to the right. In other words, if the user moves the mouse on the right side, then all content (with the exception of the object which moves according to the mouse) must move left so that the user can see part of the map on the right side.

    From now on, I created new sprite container in which I added all my objects and map. So when the user moves the mouse to the right, I move the container sprite to the left so that it looks like all things moves to the left. Code looks to as below

    var pt:Point = new Point (character.x, character.y);

    PT = dori.localToGlobal (pt);

    If (pt.x > (stage.width * 0.5))

    {

    Container.x-= 5;

    }

    The project structure is such that I add container directly to the stadium. and this container contains just like the card, character and other objects.

    Now the problem is that as soon as the mouse goes beyond middle of scene... it creates distance between the location of the mouse and the character... !! I mean it moves according to the mouse but some distance will be created between the mouse and character. and continues to increase this distance that I continue to move the mouse to the center of the stage!

    I'm really stuck with this problem. Please someone help with this. I hope I've explained that well. I would like to know if you need more information, but please help.

    use linear interpolation to determine how your objects should move.  for example, if when the mouse is at x = stage.stageWidth, bg should be stage.stageWidth - bg.width and when the mouse is in x = 0, bg must be 0 use:

    paramF (bg, stage.stageWidth, stage.stageWidth - bg.width, 0, 0);

    in a loop that updates with the movement of the mouse:

    BG.x = BG.m * MouseX + BG.b;

    function paramF(mc:MovieClip,x1:Number,y1:Number,x2:Number,y2:Number):void {}

    MC.m =(Y1-Y2) /(x1-x2);

    MC.b = Y1 - mc.m * x 1;

    }

  • Can't see Movie clip on stage in swf

    Why can't I see the berries of movie clip of gameLoop running with the code below?

    The film clips show perfectly when he was in another class file.

    I made that is not just behind other graaphics turning enything remains off.

    I know gameLoop runs because all his trace statements work.

    All I changed was the code below. There is no error message:

    package

    {

    import flash.display.MovieClip;

    import flash.text.TextField;

    import flash.events.Event;

    import flash.utils.Timer;

    import flash.events. *;

    / public dynamic class WordArray extends MovieClip

    {

    public var wordtext:wordText = new wordText;

    var activeWordArray:Array;

    public var wordsL1:Array = ['elephant', 'a', 'of', 'off', 'walk', 'no', 'got', 'in', 'East', 'it'];

    private var tf:TextField;

    public var letterArray:LetterArray;

    public var tileTimer = new Timer (500,384);

    the constructor code

    public void WordArray(_tf:TextField)

    {

    TF = _tf;

    nextWordF();

    * Run letter tiles Start *.

    letterArray = new LetterArray();

    addChild (letterArray);

    tileTimer.addEventListener (TimerEvent.TIMER, gameLoop);

    tileTimer.start ();

    }

    public void gameLoop(timerEvent:TimerEvent):void //This gameLoop a movieclips in

    an array that must be run in the swf file.

    All trace instructions work,

    but it is certainly not visible on the screen.

    {

    trace ("tile timer started");

    letterArray.gameLoop ();

    }

    * end of letterTile code *.

    You should not code in hard activeArray.  You must pass this LetterArray activeArray.

  • How to change the alignment of the existing "Movie Clip" symbol Point?

    Hi all

    by:  Adobe Flash Professional CS6

    My Flash program contains a 'Symbol' MovieClip and then to the breast of this "Movie Clip" there are 3 layers, which are about 6-7 long chassis.

    Right now is size of video Clip "1680 x 1050" and it is centered on the stage. But the registration point is in a strange situation. It seems

    as it is biased a bit and to the right.

    I was wondering if there was a way to change the point of alignment in the same way as when you create the symbol (* that is when it shows you the )

    points of type "grid" which you click on one of them and it becomes its registration point)? I read about how you can change the registration Point of

    by clicking on the Clip and then clicking on Edit > Edit Selected/symbol/In_Place. But when I try that it's really hard to get where I want it to be...

    What I want is the upper-left corner of the symbol for the registration Point, which is the top-left corner is "0,0"

    Anyway I can do without having to "Hands-free" move image to the Point of alignment... ?

    Any ideas/suggestions would be greatly appreciated!

    Thanks in advance,

    Matt

    You can always create another movieclip that you (select the mc and choose create MovieClip) and when you specify the upper left corner to be the alignment point.

Maybe you are looking for

  • Satellite 1700 - upgrade memory

    Hello anyone knows if it would be possible to use the dimm 256 MB so - 1700 Satellite or is it completely impossible because of the restriction on the motherboard? Intel chipset allows total 512 MB but manual says that 192Mo is maximum. I wonder if t

  • checksum

    Hello I use a unit of distributor of musashi with Rs232 for pressure controller and dosage times. I want to write the program in Labview for this. They UriPattern Protocol Default is 19200 bps. data length: 8 bit Start Bit: 1 Stop bit bits: 1 bit par

  • Can I synchronize Windows Live Hotmail for mac os x in the mail application? How?

    Just a PC to an iMac.  I love.  I can shoot e-mail in the Mail application that comes with mac os x, but I can't seem to synchronize.  In other words, when I delete a hotmail on the iMac message that the message is still on the hotmail web site.  In

  • I need the service packs for Windows XP

    I had to reinstall a program XP in 2001.  Cannot download service pack 1.  Get a server error.  Any suggestions on how to get the SP1 and 2?

  • Install printer HP F4580 for wireless access

    Hello I'm putting in place the printer HP F4580 to access wireless, but without success. Can someone send me the exact steps or processes that I must follow to set up my printer to wireless? I followed the installation from the CD and I could see the