views:

45

answers:

1

Hi,

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?

+1  A: 

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.

bitc
Ok, will look into that, Not sure if I should ask this as a new question, but I was thinking about this and it kind of leads on. Could I have a layer for each Graphic and then using action script choose which layer shows?I probably will add that to the main question.
Luke Duddridge
@Luke: You can layer different objects of Shape or Sprite. Each Shape or Sprite can only have one Graphic each. Another way is to use Bitmap. It is commonly used for animations.
bitc