Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Is there any limitation on the number of added child in a movieclip?

Guest
Oct 24, 2013 Oct 24, 2013

Hi,

        My application is a self-defined streaming player page. I would like to show the information of a series of video clips on the time buffer bar of my player as the following figure.seperated.png The blue parts are the valid video clips. What I want to implement are that a thumbnail will show when MouseEvent.MOUSE_MOVE is triggered and the streaming will go to the right time when MouseEvent.MOUSE_DOWN is triggered. The information of the video clips(start time and end time) is received from remote server, so I need to generate the blue bar dynamically. My codes are as follows,

for(i = 0; i < pieces.length; i++)

{

  if(pieces.end > beginning)

                    {

    var wid:Number;                  // The variable to decide the

    var rect1 = new Videoclip;   // The class of video clip, which contains the blue image

    var xx:Number;                    // position of the blue bar at x axis

    if(pieces.start >= beginning)        

    {

      wid = 840 * ((pieces.end - pieces.start) * 1.0) / ((ending - beginning) * 1.0);

      xx = 840 * ((pieces.start - beginning) * 1.0) / ((ending - beginning) * 1.0);

    }

    else

    {

      wid = 840 * ((pieces.end - beginning) * 1.0) / ((ending - beginning) * 1.0);

      xx = 0;

    }

    rect1.x = xx;

    rect1.y = -1;

    rect1.width = wid;

    rect1.addEventListener(MouseEvent.MOUSE_DOWN, progressClicked);  // add two event listener dynamically

    rect1.addEventListener(MouseEvent.MOUSE_MOVE, thumbnail);

    mcVideoControls.mcProgressFill.addChild(rect1);                                      // mcVideoControls.mcProgressFill is a movieclip symbol

                    }

}

I want to ask if there is a limitation of added child for a symbol of movieclip; also, I wonder if generating an event listener dynamically is a good idea. Thanks.

TOPICS
ActionScript
634
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2013 Oct 25, 2013

While there are limits to everything, you are not likely to come close to reaching that limit with the design you are describing (It will be a very large number).

Adding listeners dynamically is a good idea.  Removing them dynamically when they are noi longer needed is also a good idea.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 25, 2013 Oct 25, 2013

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 25, 2013 Oct 25, 2013
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines