Return to Starling Playback Library

GAFMovieClip copy issue

Questions related to Starling playback library should be asked here.

GAFMovieClip copy issue

Postby Roman Kharitonov » February 4th, 2016, 6:32 am

I have an instance of GAFMovieclip which was converted using nesting mode. I want to remove some children from somewhere inside this movie clip display objects tree. It looks like standard Starling API function DisplayObjectContainer::removeChildAt works in this case (especially if I pass dispose=true to remove child from GAFMovieClip internal data structures) but removed children come back when I create a copy of movie clip using GAFMovieClip::copy method.

Is this a feature? How can I completely remove children objects from GAFMovieClip?

P.S. It seems that DisplayObjectContainer::removeChildAt does not remove reference to removed object from GAFMovieClip dynamic object field. Even with dispose=true.
User avatar
Roman Kharitonov
 
Posts: 1
Joined: December 24th, 2015, 4:35 pm

Re: GAFMovieClip copy issue

Postby vadym.mitin » February 5th, 2016, 7:09 am

Hello Roman,

When you remove a child inside of a instance of the GAFMovieClip you are removing just an instance of the child. All the data related to the instance (states in each frame) remains. Also in the playback code we added additional check on existence of the instance that allows to play GAFMovieClip without exceptions. So removing children, that was created in "design mode" (I mean in Flash Pro) - is more an exception than a regular workflow. So I do recommend you to think about how you can avoid using this "feature" in your project. We never used this workflow even with the regular MovieClip.

Method GAFMovieclip::copy just creates a new instance of GAFMovieClip (the same result you'll get through constructor of the GAFMovieClip). GAFMovieClip doesn't save an information about removed or added children so it can't create exact copy of the instance. If we will save the information about removed child this means that from the one hand we are removing a child instance, but from the other hand we remember it - that doesn't make sense.

Is this a feature? How can I completely remove children objects from GAFMovieClip?

Child created in design mode in Flash Pro can be completely removed only in design mode in Flash Pro.

P.S. It seems that DisplayObjectContainer::removeChildAt does not remove reference to removed object from GAFMovieClip dynamic object field. Even with dispose=true.

Thanks for the notice, already fixed.
User avatar
vadym.mitin
 
Posts: 254
Joined: December 4th, 2013, 8:00 am

Re: GAFMovieClip copy issue

Postby Lê Huy Hùng » February 18th, 2016, 12:10 am

src\com\catalystapps\gaf\display\GAFMovieClip.as:1327:Warning: Duplicate variable definition: instanceName.

i updated lastest version and output show this warning :D
User avatar
Lê Huy Hùng
 
Posts: 61
Joined: July 3rd, 2015, 8:32 pm

Re: GAFMovieClip copy issue

Postby Назар Левицкий » February 18th, 2016, 1:12 am

Lê Huy Hùng wrote:Warning: Duplicate variable definition: instanceName.


fixed )
User avatar
Назар Левицкий
 
Posts: 12
Joined: June 6th, 2014, 12:01 am

Return to Starling Playback Library

Who is online

Users browsing this forum: No registered users and 1 guest