Return to Starling Playback Library

Swapping GAFMovieClip child

Questions related to Starling playback library should be asked here.

Swapping GAFMovieClip child

Postby Nicolas Bousquet » September 29th, 2015, 4:54 am

Hi,

I have a MovieClip I converted to a GAF animation. Inside this movie clip I have a name symbol I use to replace with the content I want to show (and therefore animate like it was part of the clip).
I can access the child by its name, the method returns a GAFImage. So obviously I can't add a child inside it.
The weirdest thing is the instance of GAFImage has no parent "parent = null", so I can't either access the parent to add the child there.
And when I create a GAFTexture and replace it, there is no way to scale or change position on the GAFImage - my texture are scaled for the target device, and the GAFMovieClip instance is scaled as well, so, double scale.

So, my questions are
- Is there a way to force the holder to be converted as a DisplayObjectContainer instance and not an Image to use it as parent
- Is there a way to scale a GAFTexture to fit the content?

I don't want to track the holder's position frame by frame and clone the position for my content, since there are objects above the holder in the Z order.
User avatar
Nicolas Bousquet
 
Posts: 9
Joined: September 10th, 2015, 6:11 am

Re: Swapping GAFMovieClip child

Postby Nicolas Bousquet » September 29th, 2015, 5:02 am

OK, while the parent is indeed null for the first frame, it is not afterwards. I may be able to resolve this.
User avatar
Nicolas Bousquet
 
Posts: 9
Joined: September 10th, 2015, 6:11 am

Re: Swapping GAFMovieClip child

Postby vadym.mitin » September 29th, 2015, 8:42 am

- Is there a way to force the holder to be converted as a DisplayObjectContainer instance and not an Image to use it as parent

You can find the rules when GAF Converter creates a GAFImage in this topic
http://gafmedia.com/forum/viewtopic.php?f=4&t=433
Please note that this rule is related only to the conversion mode Nesting. When you are using conversion mode Plain - all children of the GAFMovieClip will be a GAFImage. More information about conversion modes you can find in this article
http://gafmedia.com/documentation/conversion-modes-plain-and-nesting

Therefore, if you need create a "placeholder", that will be a GAFMovieClip after the conversion, you need to put into the placeholder an instance of an empty Movie Clip and give it an Instance Name (any name). That's it. You can add children into a GAFMovieClip.

- Is there a way to scale a GAFTexture to fit the content?

Please provide a demo that will show us expected result. Because right now it is not clear what do you mean.
User avatar
vadym.mitin
 
Posts: 254
Joined: December 4th, 2013, 8:00 am

Re: Swapping GAFMovieClip child

Postby Nicolas Bousquet » September 29th, 2015, 9:43 am

Thanks Vadym, the link was very interesting.

I found a way to do what I wanted to do, so no need for texture scale or such.
User avatar
Nicolas Bousquet
 
Posts: 9
Joined: September 10th, 2015, 6:11 am

Re: Swapping GAFMovieClip child

Postby vadym.mitin » September 30th, 2015, 12:25 am

Nicolas,

Glad to hear that! Also you may find a helpful information on our Documentation page. This page contain links to articles about GAF in general (what is GAF, how does it works, GAF components, etc.) and some interesting "how to" articles.
http://gafmedia.com/documentation
User avatar
vadym.mitin
 
Posts: 254
Joined: December 4th, 2013, 8:00 am

Return to Starling Playback Library

Who is online

Users browsing this forum: No registered users and 2 guests