Pergunta

I have an object which is coded in a .as file, let's call it a widget, in widget.as. It is listed in the library as a MovieClip and is in fact a MovieClip. How can I, from the code in widget.as, overlay an image (Bitmap) from the library on it so that the Widget has four parts which can be switched between two different styles independently.

As an alternative, I could make a frame in the MovieClip of Widget for each possibility and make the code switch what frame I am on.

This must work in Adobe Flash CS3 and with ActionScript 3

Foi útil?

Solução

If you have the image you want to show on top of it, and already have that split in four, then you could do something like this:

var tl:Bitmap = new Bitmap();
var tr:Bitmap = new Bitmap();
var bl:Bitmap = new Bitmap();
var br:Bitmap = new Bitmap();

addChild(tl);
addChild(tr);
addChild(bl);
addChild(br);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top