This is just a small something for a couple of people that asked me about it. I used a small doodle from a while ago and tried to really summarize the steps that I go through when making my dress up flashes.
I'm not sure how well I explained everything but you might need some minimal knowledge of flash and ActionScript so that you're not just completely confused. Also some things might be slightly different between flash versions, and the code is specifically for ActionScript 3.
If you don't know programming well, I recommend putting the buttons either on the right or bottom, because using this method will place all the layers on the top left corner (though it's not hard to specify a different position if you look up the AS commands).
I don't think there are any tags to make the code keep the indentation or to even collapse it, but I'll keep it in the comments in case something happens to the above link.
package Classes {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.ByteArray;
import com.adobe.images.PNGEncoder;
public class Engine extends MovieClip {
var scf:Bitmap = new Bitmap(new scarf());
var sho:Bitmap = new Bitmap(new shorts());
public function Engine() : void {
stage.addChild(sho);
stage.addChild(scf);
scf_button.addEventListener(MouseEvent.MOUSE_DOWN, scf_function);
sho_button.addEventListener(MouseEvent.MOUSE_DOWN, sho_function);
sav_button.addEventListener(MouseEvent.MOUSE_DOWN, sav_function);
scf.alpha=0;
}
function scf_function(event:MouseEvent):void {
if (scf.alpha==1) {
scf.alpha=0;
} else {
scf.alpha=1;
}
}
function sho_function(event:MouseEvent):void {
if (sho.alpha==1) {
sho.alpha=0;
} else {
sho.alpha=1;
}
}
private var fileReference:FileReference;
public function sav_function(evt:MouseEvent):void {
var b:BitmapData = new BitmapData(350, 550);
b.draw(stage);
save(b);
}
public function save(b:BitmapData):void {
try {
var pngBytes:ByteArray= PNGEncoder.encode(b);
fileReference=new FileReference();
fileReference.save(pngBytes,"tutorial.png");
} catch (e:Error) {
trace(e);
}
}
}
}
Keywords
male
1,169,069,
rabbit
135,699,
bunny
109,961,
male/solo
34,404,
shorts
10,615,
scarf
8,188,
flash
3,880,
tutorial
607
Details
Type:
Shockwave/Flash - Animation
Published:
8 years, 11 months ago
08 Dec 2015 22:37 CET
Initial: fd8c7852f6dd2c404143c3aede789b43
Full Size: fd8c7852f6dd2c404143c3aede789b43
Stats
3,555 views
140 favorites
17 comments