ekessler Posted May 9, 2012 Share Posted May 9, 2012 I am having trouble with using a blitmask. It is most probably newbee mistakes. Here is my code: var myBlitMask:BlitMask = new BlitMask(help_mc, 0, 0, stage.width, stage.height,false); help_btn1.addEventListener(MouseEvent.CLICK, helpMove_fn1); function helpMove_fn1(event:MouseEvent):void { hideHelpClose_btn (); TweenMax.to(help_mc,1.5,{x:helpMove * 0, ease:Expo.easeOut, onStart:myBlitMask.enableBitmapMode, onUpdate:myBlitMask.update}); } help_mc is 10,240 wide. I get the following error: ArgumentError: Error #2015: Invalid BitmapData. at flash.display::BitmapData/ctor() at flash.display::BitmapData() at com.greensock::BlitMask() at dikdukgamewithtextfile_fla::MainTimeline/onload() at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/onComplete() What am I doing wrong? Thanks as always. Link to comment Share on other sites More sharing options...
Carl Posted May 9, 2012 Share Posted May 9, 2012 My first guess would be that help_mc is too large. Flash has limitations on how much BitmapData can be stored. Try the same code but make help_mc 1000px wide. If it works you you know the code is good. Let us know what happens. Link to comment Share on other sites More sharing options...
GreenSock Posted May 9, 2012 Share Posted May 9, 2012 Yep, it sounds like you hit the memory limit in Flash - this is unrelated to BlitMask. You can replicate the problem by creating a loop that instantiates multiple large BitmapData objects and Flash will burp eventually throwing that cryptic error. I'm not aware of any workarounds besides using smaller assets that don't require so much memory. Link to comment Share on other sites More sharing options...
ekessler Posted May 9, 2012 Author Share Posted May 9, 2012 I guess that was it. When I tested it by making the mc 1000 it worked. I guess I will have to do without it. Thanks. Link to comment Share on other sites More sharing options...
Applauz Posted May 15, 2012 Share Posted May 15, 2012 this isn't true... as I am using blitmask with a 25,000 pixel wide movie clip. I have seen this error when I use stage.width and stage.height in the parameters. Try changing your width and height in your parameters to actual numeric values. i.e. 1024, 768 also .. add the smoothing parameter ,true or ,false Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now