Search code examples
flashactionscriptinstancegraphic

Changing Graphic Instance using ActionScript


I was wondering if it is at all possible to change the "Graphic" used in a frame dynamically using actionscript.

I was hoping to either change the image the Graphic is an instance of or change the Graphic I am using in the current frame.

Cheers

Addition: Could I have a layer for each Graphic and then using action script choose which layer shows?


Solution

  • In AS 3 the "Graphics" object is read-only so you cannot change it. But you can use graphics.clear(); and then draw another image.