PDA

View Full Version : Flex Frame Generation



theCodeBot
November 1st, 2008, 09:12 AM
I don't know how to make new frames for MovieClips in Flex... I'm trying to make a class to use sprite maps (imported to the movie via the mx:Image component) and slice 'em up and put the slices onto movieclip frames, returning the movieclip.

It loads, it slices, it places the slices in the clip, returns the clip, all the fun stuff. But it places the slices on on top of another instead of moving to another frame first.

//snippet
public function Pixie(clipObject:Object) {
for(var i:String in clipObject) {
//clipObject is a list of Bitmaps:
//{"standFrame":someBitmap,"walkFrame":someBitmap, etc}
this.gotoAndStop(i);
this.addChild(clipObject[i]);
}
this.gotoAndStop(1);
//It doesn't change frames, obviously, since the frames weren't created
//I would like to create the frames so I can go to them.
}

theCodeBot
November 1st, 2008, 11:09 PM
Nevermind. Turned it into a class to remove existing bitmap and add the new one in an override for gotoAndStop, behaves 90% like a normal MovieClip now if you couldn't use play(), stop(), or gotoAndPlay() :P