Forum ActionScript 3.0 need help getting movieclip to bitmap

Problems and discussions relating to ActionScript 3.0 here.

need help getting movieclip to bitmap

Postby kuvi » July 25th, 2013, 10:51 am

i was just wondering, im in the process of making a multiplayer archery game, and i want to know if theres a way to have all the projectiles never have to dissapear visually, without hogging tons of memory. I was just thinking, if a player had to load in and sync with all those objects, it would take forever to download all of them. What i was conceptualizing instead was -- having a snapshot being taken of a movieclip (in this case arrows) then have it broken down into a bitmap image and then supperimposed on whatever it hitTested with (whether it be the ground, a building, or the torso of a moving enemy movieclip)

anyways ive done alot of reading and testing and nothings worked for me yet, anyone have suggestions?
this is the code ive got thats getting me the closest so far:

var tempclip = npa.theicon //assign an array[object[MovieClip()]] to an easier variable
var still:MovieClip = new MovieClip() //still-life bitmap image i want to spit out

var newpicdata:BitmapData = new BitmapData(tempclip.width, tempclip.height, false, 0x000000);
var newpic:Bitmap = new Bitmap(newpicdata);
newpicdata.draw(tempclip);
still.addChild(newpic);

still.x = 300
still.y = 400

gw.addChild(still) //gamewindow movieclip which is my equivilent of a stage except i can move everything at once



the result i keep getting is a correct dimension block (with the acception of being off by 90% which is wierd) but it wont actually draw the picture of what its spose to copy. oh well, any ideas would be welcome
kuvi
 
Posts: 11
Joined: March 29th, 2011, 12:32 am

Return to ActionScript 3.0



cron