Jump to content
Search Community

Blitmask not updating after recapture

ptc test
Moderator Tag

Recommended Posts

Hi, I'm using the BlitMask class in conjunction with Jack's panel-based flick-scrolling example. Basically, I am adding and removing clips nested inside a main clip as the panels scroll. I'm doing this so that I don't have to preload all the panels.

 

The issue I'm having is that when I need to update the internal bitmap of the blitmask - using update(null,true) - the blitmask does not always update. It updates sometimes, just not all the time. I know it should be updating, because when I change bitmap mode to false I can see the changes to the target.

 

I am writing the code in FlashBuilder, and packaging for the iPad. Also, I can see a memory leak in the program when profiling. I'm not sure whether this is caused by bitmapdata objects not being disposed properly or not, could the problems be related?

Link to comment
Share on other sites

I'm very curious to see an example. A few thoughts/questions come to mind:

 

1) Does your target (masked object) contain components of some kind? There are several Adobe components that do NOT render right away, so when you make changes they still might take a frame or two to update (VERY annoying, I know). So maybe you're telling BlitMask to update() and it's doing it's job correctly, but it looks like it's failing because the target took a while to render itself (and by the time it did, the update() already happened).

 

2) Are you using the latest version of BlitMask? Definitely make sure you are.

 

3) Can you post a sample that clearly shows the memory leak? Feel free to look at the BlitMask code yourself - I think you'll see that the BitmapData objects are being properly disposed of. I'm not aware of any memory leaks or bugs at this point in BlitMask (although maybe you stumbled across one that nobody knew about in which case I'd be grateful for the assist in getting it identified and squashed).

 

Please keep your example as simple as possible, and don't forget to zip your files before posting here.

Link to comment
Share on other sites

Hi, thanks for the prompt reply. I can't really give you an example because the project I am working on is a mixed Flex and actionscript project, and it is quite complicated, so not really worth your time looking at. By the way, I love all your greensock utilities. They are incredibly useful as I'm sure you know, definitely the best actionscript library around.

 

I can let you know what I was doing, just in case it is relevant. Basically I was using your scoll panel inside a blitmask to display magazine pages converted from pdf files, except I was loading them dynamically. So, what I did was to create a class using LoaderMax, to load jpg and swf files. I then created a custom flex component for the panel scroller, which dynamically adds the content, first the bitmap images (because they load faster) then later swaps them for the swfs. I also used your throw props for vertical scrolling.

 

Anyway, the problem I found was that I had set cacheAsBitmap to true on some nested clips. There was no reason for this as they were in a blitmask, it is just a habit I suppose. When I commented out the cacheAsBitmap=true everything worked as expected. By the way, I wasn't using any components, just my custom component. So is it true that you cannot set cacheAsBitmap to true on any clips or subclips inside a blitmask?

 

The memory leak issue was probably caused by my own crappy coding, I'm sure everything is fine with BlitMask, you know what you are doing. By the way, have you ever created, or do you know of any really good panel scrollers which load content dynamically? I would love to know.

 

Thanks Jack,

 

Patrick

Link to comment
Share on other sites

By the way, I wasn't using any components, just my custom component. So is it true that you cannot set cacheAsBitmap to true on any clips or subclips inside a blitmask?

I'm not aware of any such restrictions, no.

 

have you ever created, or do you know of any really good panel scrollers which load content dynamically? I would love to know.

Unfortunately, no, but I'm sure there are some good ones out there. Wish I had some links for you, but I got nuthin' :)

 

Glad you figured out the issue. Thanks for letting us know.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...