Author Topic: Using scripts to move objects instead of manual animation  (Read 1232 times)

  • Administrator
  • Sr. Member
  • *****
  • Posts: 407
    • View Profile
Re: Using scripts to move objects instead of manual animation
« on: January 03, 2020, 01:48:57 am »
There is a corner case when things doesn't work properly with SWF - ActionScript duality.
SWF DefineSprite should be equivalent to ActionScript MovieClip class. Both define the same thing in Flash. But it's not.

You can read and write properties and call MovieClip class methods of an object defined by DefineSprite in SWF. But if you change certain properties: coordinates, scale or rotation, of MovieClip type object that is animated by a PlaceObject2() tags with move flag and Matrix table (modifying coordinates, scale or rotation), then object property is succesfuly changed and applied, but DefineSprite animation by PlaceObject tags stops working.

It seems like DefineSprite tag in SWF file does not create MovieClip type object, but something simpler. When ActionScript manipulates object in certain way, Flash player converts that object to MovieClip type which is not fully backwards compatible.
Obviously the Flash player programmer didn't anticipate that someone would manipulate object both by SWF tags and AS2 scripts. After all it doesn't make much sense unless you are using script to extend an existing flash animation.

I've run into that issue when I tried to change breast size of animated breast object depending on prego level.
I can thing of two or three workaround approaches for that. Either to create a wrapper object to nest the current one, so one is animated flash style and other script way, or when change of object hierarchy would break existing scripts calling that object, then to create a dummy object of the same name and frame count, to catch other scripts calls and move the true object accordingly.

I deferred breast size change implementation until I have done far more essential prego belly in all Rio & Charlotte scenes.
So far I have improved Rio cowgirl belly animation & drawing and done Rio barstool scene belly.