I want an instance for a flag image. So have used a flag holding image “flag.png” and created a symbol from it (Type: MovieClip, InstanceName: Flag) - however it doesn’t generate this InstanceName during template creation…
The symbol is within a symbol, but that shouldn’t matter (have tried in the top layer)…
On a positive note, I managed to fix a different issue I was having thanks to some posts on here!
@tomtailford Do you want to replace the flag with another file based on template fields?
Do you want it replaced with an external file (eg png from folder) or an internal asset?
Thanks very much, so was able to create a UILoader & give it an instance name.
I then created the .ft file next to the template (in the CCG templates directory) and modified the lines thinking I could then use Key/Value within the CCG client… but I’m guessing it doesn’t quite work like that?!
I’m guessing I now need to learn how to send XML data to the template?! Or am I way off…
This has probably been asked multiple times before, but I couldn’t find a tutorial that explains all the bits (there’s plenty of examples replacing text, but not images!)
I think I’ve followed it OK - but it’s now inserting the XML data into the template itself (or if it works should I be able to do this from CCG client with Key/Value?)
The second fix is that the image isn’t in the root document but in an object. So you need to give the Box2 an instance name, eg. FlagBox and then in the class you should apply the source like this:
I’ve applied the class, relatively simple - and was in @didikunz tutorial (however I missed due to lack of understanding / detail on how to do it for a complete amateur!)
I was able to use Key/Value by dropping the UILoader into it’s own layer - however animation didn’t seem to work. Having done a bit more research - it seems this is due to AS3 not liking classical tweens, so I’ve made a motion tween - which previews nicely in Animate.
However, it’s not working in CCG.
Render - Cache as bitmap / Transparent (also tried Opaque)
I thought maybe it’s because I wasn’t nesting in a symbol. So I tired this too, however when compiling using your code example I get “1120: Access of undefined property newsymbol.”