GamesChart and the Mochi Version Control

Some days ago GamesChart Barry White brought to my attention a problem with Mochi’s version control system but there was a bit of a mystery around it since it only affected one of the possible implementations of GamesChart API: if it was implemented with the drag-and-drop component, it would not work, if it was added to a Flex project, it would.

Mochi’s Version Control works as a wrapper, which usually brings some issues related to accessing the stage property. I concluded that dragging and dropping the component to the stage was for sure the problem but couldn’t find a workaround to it. Has far as I could have thought, I couldn’t call the component the same way I did with a Flex SDK project.

Barry then showed me a work around that is just amazing for its simplicity. Robert Köhler (check his games here) didn’t drag the component to the stage but rather exported it as a class. In the timeline he wrote the setup code and it worked.

After a chat with Barry and Robert, it was obvious that it was the immediate access to the stage that created the problem with Mochi’s Version Control. With the Flex SDK implementation, the setup is made AFTER the stage is ready.

To make things simple for everyone, here’s a CS3 FLA showing how to do it, but the rule of thumb to use GamesChart with Flash IDE and Mochi’s Version Control is: don’t drag the component to the stage, call the setup method from the timeline or your code as long as you check if the stage is available.

All credit goes to Robert! We are just spreading the word. :)

Posted: March 31st, 2010
at 12:07pm by Vlad

Tagged with ,


Categories: Caught our Attention

Comments: 2 comments