Home Tutorials Forums Articles Blogs Movies Library Employment Press
Prev Previous Post   Next Post Next
Old 09-23-2009, 09:51 PM   #1
Super Moderator
ASWC's Avatar
Join Date: Dec 2007
Location: Greenville, SC
Posts: 6,528
Default Reusing Objects in a Dynamic Drawing.

I want an object to be restyled with any drawing and number of sprite/bitmap/shape/movieclips and all this without recreating any of these if I don't have to because then the application can redraw the object anytime using the current style. The goal being to save resources. I already implemented a solution but I'd like to know how you guys would go about this. Basically the solution I have now is make the new style requests a number and type of objects first.

So let's say it requests 3 bitmaps and 2 sprites. A method checks the current object state and get rid of all objects that are not of the type required. Then it checks if there are at least 3 bitmaps and 2 sprites available and clear them and return them for the new style to use. If there's too many of these, the method removes the not needed ones. Then of course it gives all this back to the style with correct depth and the style draws or puts whatever in them. Of course if some type are missing the method creates them and returns them.

Does that seem a good solution?
Super Duper!
ASWC is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:34 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.